Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
If we register to a static eventhandler but not unregister from it, it causes a memory leak.
I implemented a code issue for that.
Would be nice if you could check that for your use cases.
Created attachment 6088 [details]
To checked this issue, I have created a static event handler. Attached sample project is for that same. I followed below steps:
1. Created Event class for static event handler.
2. Created two methods in same class.
3. Created two object (Object2, Object3) of Event class in main class.
4. Register Event handler with these object.
5. Unregister Object3 and invoked event handler.
6. Noticed that Event handler invoked both methods.
Please let me know if this test project is sufficient to verify this issue.
Ah you try to add to a static event in a static method - that is a case where I can't really decide if it's a problem or not.
Created attachment 6301 [details]
I have created sample project for Static Event Handler added in Comment 4.
1. I have added code to release the object.
2. I go to task manager to check it, memory was not leaking.
3. Then i commented the code which release the object.
4. Again go to task manager to check the memory.
5. I followed the step 3 and 4 more than 5-6 times.
Memory was not leaking.
Environment Info :
XS 4.2.4 (build 32)
As per my understanding, it seems to be working fine. Please review and let me know if you have any suggestion for the same.