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

Took into account of the reference of unmanaged instances #217

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

CihatAltiparmak
Copy link

@CihatAltiparmak CihatAltiparmak commented Dec 7, 2024

Adresses : #218
I have increased plugin_ref_count_ even when unmanaged instances is created. plugin_ref_count_ is only changed inside onPluginDeletion function and createRawInstance. onPluginDeletion is not executed for unmanaged raw instances. Thus, when plugin loader is deleted, shared library is not unloaded. In main branch, it directly unloads library in case only createUnmanagedInstance method is used as seen in the example in addressed issue.

I have also debugged with valgrind and it has below results.

My PR : https://gist.githubusercontent.com/DarkusAlphaHydranoid/7bde368143c6844ec427159e300cb2fc/raw/0ccecc5e9716fd85d315fc970c9724f96231424f/valgrind_log_class_loader_pr_217.txt

Your main branch: https://gist.githubusercontent.com/DarkusAlphaHydranoid/7bde368143c6844ec427159e300cb2fc/raw/0ccecc5e9716fd85d315fc970c9724f96231424f/valgrind_log_class_loader_commit_464fd14.txt

Looks like my branch has less memory leak.

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

Successfully merging this pull request may close these issues.

1 participant