Bug 33499 - Android WebViewRenderer doesn't unhook events properly
Summary: Android WebViewRenderer doesn't unhook events properly
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
Reported: 2015-08-30 22:11 UTC by david
Modified: 2015-10-28 06:15 UTC (History)
5 users (show)

Tags: ac
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:

Description david 2015-08-30 22:11:12 UTC
Browsing the Android WebViewRenderer source over the weekend I noticed that in OnElementChanged the code doesn't unhook the various events properly:

if (e.OldElement != null)
    e.OldElement.EvalRequested -= new EventHandler...
    e.NewElement.GoBackRequested -= new EventHandler...
    e.NewElement.GoForwardRequested -= new EventHandler...

Unless I've missed something fundamental, the two lines with e.NewElement should read e.OldElement instead.
Comment 1 Parmendra Kumar 2015-09-04 14:02:06 UTC
I have tried to reproduce this issue with provided code in bug description and not able to reproduce it.

Could you please provide us sample project? so that we can reproduce it at our end.

Environment info:

Xamarin.Forms: 1.5.0-pre3
Xamarin Studio  5.9.5 (build 9)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Mono 4.0.4 ((detached/5ab4c0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400040001
Xcode 6.2 (6776)
Xamarin.iOS : (Enterprise Edition)
Xamarin.Android : (Enterprise Edition)
Mac OS X 10.9.4
Comment 2 david 2015-09-04 17:00:52 UTC
It's not my code - it's the code in the Android WebViewRenderer in the Xamarin.Forms library.

It's possible that 1.5.0-pre3 has already fixed the problem, but it's definitely there in the version I'm using (1.4.4, as noted in the bug report settings).
Comment 3 Rui Marinho 2015-10-14 06:07:55 UTC
Should be fixed in 1.5.2-pre1