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

Object: Fix ToggleRef disposing when we're being finalized #32

Closed
wants to merge 1 commit into from

Conversation

bl8
Copy link
Contributor

@bl8 bl8 commented Dec 4, 2011

We should not try to dispose our ToggleRef when Dispose(bool) has been
called by the finalizer, because we should not reference any managed
objects.

Set and check the disposed flag inside of Dispose(bool) so that it's
also done when the object is finalized.

Also clear up a confusion between a local ToggleRef variable in Dispose
and the ToggleRef member field.

A close inspection is needed on this one, to double-check that I'm not introducing any leak...

We should not try to dispose our ToggleRef when Dispose(bool) has been
called by the finalizer, because we should not reference any managed
objects.

Set and check the disposed flag inside of Dispose(bool) so that it's
also done when the object is finalized.

Also clear up a confusion between a local ToggleRef variable in Dispose
and the ToggleRef member field.
@mkestner
Copy link
Contributor

Sorry this sat so long. Was this fixing an issue you had seen with your porting work?

I think in order to avoid leaks, the ToggleRef class will need a Finalizer which does the native unref.

@bl8
Copy link
Contributor Author

bl8 commented Mar 29, 2012

I think was fixing a crash or an exception when exiting Banshee, but now I can't reproduce the problem.
Maybe I'm just mis-remembering things, and this was just a clean-up.

In any case, feel free to ignore this patch for now and do things differently if you wish. I'll ping this issue again if the problem comes back.

@mkestner mkestner closed this Apr 7, 2012
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.

None yet

2 participants