Warning, /sdk/cutehmi/extensions/CuteHMI.2/dev/CuteHMI-2.workaround.std.design.txt is written in an unsupported language. File is not indexed.

0001 Problem:
0002 
0003 Function std::unique_ptr::reset() sets internal pointer to nullptr and only after that it will
0004 delete its contents. This causes error, when managed object still needs to be accessed through 
0005 std::unique_ptr::get() function by members of managed object during their destruction.
0006 
0007 Workaround:
0008 
0009 Use additional raw pointer to return instance of managed object.
0010 In general this prevents std::unique_ptr from being used in inconsistent state 
0011 (calling std::unique_ptr::get() while inside std::unique_ptr::reset()).
0012         
0013 Snippet: