Ticket #1320 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Race conditions with creation and destruction of OverviewMap

Reported by: ahocevar Owned by: tschaub
Priority: minor Milestone: 2.6 Release
Component: Control.OverviewMap Version: 2.5
Keywords: Cc:
State: Complete

Description

Currently, the update() method of Control.OverviewMap is bound to the moveend event before the initial call of update(), which is there to create the overview map. In some occasions, if the moveend event is triggered before the initial update is finished, the overview map will break because createMap() will run twice at the same time.

The attached patch fixes this by registering update() for the moveend event after calling update() manually.

Note that this patch also removes the clickHandler deactivate/activate cycle, which is obsolete now that #1247 is fixed.

All tests pass in FF2 and IE6.

Attachments

1320-r5982-A0.patch Download (1.3 KB) - added by ahocevar 5 years ago.
1320-r5985-A1.patch Download (1.8 KB) - added by ahocevar 5 years ago.

Change History

Changed 5 years ago by ahocevar

Changed 5 years ago by ahocevar

  • state set to Review

Changed 5 years ago by ahocevar

  • summary changed from OverviewMap will break if moveend is triggered too early to Problems with creation and destruction of OverviewMap

In addition to the problems on creation of the OverviewMap controls, IE will also choke when the page unloads. This is due to the fact that an OL.Map object registers its destroy method for window.unload. We do not want to do this, because the ovmap might already be destroyed before OverviewMap.destroy() is run. See examples/overviewmap.html to see that.

The second patch (1320-r5985-A1.patch) includes the changes of the previous patch, plus unregisters the window.unload event for the ovmap.

All tests pass in FF2 and IE6.

Changed 5 years ago by ahocevar

Changed 5 years ago by ahocevar

  • owner set to tschaub
  • type changed from feature to bug
  • summary changed from Problems with creation and destruction of OverviewMap to Race conditions with creation and destruction of OverviewMap
  • component changed from general to Control.OverviewMap
  • milestone set to 2.6 Release

Changed 5 years ago by tschaub

  • state changed from Review to Commit

Nice catches. Please commit.

Changed 5 years ago by ahocevar

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [6010]) Race conditions with creation and destruction of OverviewMap. r=tschaub (closes #1320)

Note: See TracTickets for help on using tickets.