[fusion-dev] [Code Review]: #396 -- Calling map.reloadMap() twice at same time result in error

Buddy Hu Buddy.Hu at autodesk.com
Sat Jun 12 05:39:32 EDT 2010


Hi List,

I attached a patch for the ticket #396 to fix this issue, please review it.
Link: https://trac.osgeo.org/fusion/ticket/396

[Problem]:
After thread 1 calling the map.reloadMap(), the global variable this.oldLayers is set to null (in the mapReloaded() function). At this time, if the thread 2 is calling the map.reloadMap(), we will get a exception when running the following code:
for (var j=0; j<this.oldLayers.length; ++j)
Because the variable this.oldLayers is set to null by the thread 1.

[Solution]:
We should use a local variable oldLayers instead of a global variable this.oldLayers. And use it as a argument to the function mapReloaded().

Thanks,
-Buddy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-dev/attachments/20100612/214b0240/attachment.html


More information about the fusion-dev mailing list