Open LokiNinja opened 8 months ago
It is necessary to check the use count. In X Window, all font objects should be deleted before deleting storage, otherwise it crashes.
All widgets are not copyable and moveable.
Hey Jinhao,
Its possible that there may be a copy happening somewhere that I am not aware of. I would recommend that you use '= delete' for copy and move constructors/assignment operators. That way this would be a compile error instead of a runtime error and it may show me where the copy is happening so that I can fix it in my code.
-Thanks,
Thomas
Dear god....WHY WHY do you mixed shared pointers with regular pointers. You explicitly check a shared ptr use count on exit and throw an exception but WHY? The shared ptr will clean that up anyways. If its a C pointer then there is NO reason to use a shared ptr...either way its an error. It's causing an exception on exit for me. It's the platform font shared ptr...In particular, its this that is throwing exception![image](https://github.com/cnjinhao/nana/assets/6148141/55cfc044-26e5-4a89-beab-18b4053ac4b5)
Please do not do that...Just clean up in destructor which will happen with the reset call after the if
Just use a shared pointer with a custom allocator that cleans it up correctly
EDIT: I think you have a copy constructor for label class that is no good. It works fine as long as I don't pass s label to another class