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

The plugin's resources are still in use during program exit. #11

Open
willnationsdev opened this issue Jan 6, 2018 · 3 comments
Open
Labels

Comments

@willnationsdev
Copy link
Owner

Currently, if you close the editor with the plugin active, you will see error messages. They are some memory leaks in the Inheritance Dock that I need to track down. For now, some errors will show up if you close the editor with the plugin active. (since it clears the resource cache and memory pool regardless.

@willnationsdev
Copy link
Owner Author

willnationsdev commented Jan 11, 2018

This has something to do with the compilation of the RegEx objects in FilterMenuItems during the time inheritance dock initializes config files and sets up filters in the _ready statement of the Inheritance Dock. If you comment out the _regex.compile command in the filter_menu_item.gd script, this memory leak stops happening, but I can't seem to reproduce it in a project that deals with a standalone RegEx object, so it must have something to do with the way I'm using the object(s). And the objects are compiling succesfully. I've confirmed that I don't need to call clear() beforehand (the source code takes care of that for me).

@willnationsdev
Copy link
Owner Author

Maybe this isn't quite a memory leak. The error explicitly says...

ERROR: ResourceCache::clear: Resources Still in use at Exit!
At: core\resource.cpp:418
ERROR: There are still MemoryPool allocs in use at exit!
At: core\dvector.cpp:70

And since it only happens at close, it might have less to do with calling compile itself, and more to do with the fact that the RegEx object is being actively used or triggered during shut down procedures. Which would only happen if the filter menu item's regex_edit node's text property is assigned a value at the same time that the RegEx object is being removed (which would actually make sense).

@willnationsdev willnationsdev changed the title The plugin is improperly deleting its memory. The plugin's resources are still in use during program exit. Jan 12, 2018
@willnationsdev
Copy link
Owner Author

willnationsdev commented Jan 12, 2018

Perhaps this could be "fixed" by not recompiling the regex unless the user manually clicks on a re-compile button within the FilterMenuItem. That would also prevent the editor from printing "cannot compile, bad regex!" errors every time you type a character into the Regex LineEdit.

Edit: actually, it would be simpler to just have it trigger when the user explicitly clicks "ENTER" while on the LineEdit. Preserves the usability level without auto-triggering regex compilation every time the value is set.

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

No branches or pull requests

1 participant