Add destroy() to Control.OverviewMap and add a check to map.destroy() to bail if it's already been called (by, say, window.onunload). Fixes #595.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2958 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -237,6 +237,10 @@ OpenLayers.Map.prototype = {
|
||||
* @private
|
||||
*/
|
||||
destroy:function() {
|
||||
// if unloadDestroy is null, we've already been destroyed
|
||||
if (!this.unloadDestroy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// map has been destroyed. dont do it again!
|
||||
OpenLayers.Event.stopObserving(window, 'unload', this.unloadDestroy);
|
||||
|
||||
Reference in New Issue
Block a user