Bug 24060 - iOS MapRenderer.Dispose adding an event handler instead of removing it
Summary: iOS MapRenderer.Dispose adding an event handler instead of removing it
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-26 19:56 UTC by luca.barbieri
Modified: 2016-03-25 18:11 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description luca.barbieri 2014-10-26 19:56:59 UTC
This is the code of MapRenderer.Dispose:
	public class MapRenderer : ViewRenderer
	{
		//
		// Methods
		//
		protected override void Dispose (bool disposing)
		{
			if (disposing) {
				Map map = (Map)base.Element;
				((ObservableCollection<Pin>)map.Pins).add_CollectionChanged (new NotifyCollectionChangedEventHandler (this.OnCollectionChanged));
			}
			base.Dispose (disposing);
		}
	}

Obviously Dispose should remove event handlers, not add them...

Clearly someone copy&pasted the code, forgot to replace "+=" with "-=" and never tested this code.
Comment 1 Shruti 2015-02-06 02:20:44 UTC
I have checked this issue and I am not getting definition of Maprender .

Screencast:  http://www.screencast.com/t/kFf6ym9J1kfh

Could you please provide us Xamarin.Forms.Maps Version, So that I can able to reproduce at our end.

Environment Info:
Xamarin.Forms.Maps Version: 1.3.3.6321-pre 2
Xamarin.Forms.Maps  version: 1.3.0.6292
=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: 8.6.0.51 (Enterprise Edition)
Hash: dfb682f
Branch: 
Build date: 2015-01-08 13:39:32-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Enterprise Edition)
Android SDK: /Users/mac360_xamarin/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin.Mac ===

Version: 1.10.0.18 (Enterprise Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.0
Darwin mac360-xamarins-Mac-mini.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 Jason Smith [MSFT] 2016-03-25 18:11:36 UTC
This is no longer the case