Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font use count is 2 on exit throwing exception #679

Open
LokiNinja opened this issue Oct 21, 2023 · 2 comments
Open

Font use count is 2 on exit throwing exception #679

LokiNinja opened this issue Oct 21, 2023 · 2 comments

Comments

@LokiNinja
Copy link

LokiNinja commented Oct 21, 2023

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

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

@cnjinhao
Copy link
Owner

cnjinhao commented Nov 9, 2023

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.

@LokiNinja
Copy link
Author

LokiNinja commented Nov 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants