Ticket #2864 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

cannot destroy a map with panels

Reported by: erilem Owned by: ahocevar
Priority: critical Milestone: 2.11 Release
Component: general Version: 2.10
Keywords: Cc: erilem, xavier.mamano@…
State: Complete

Description

This is a regression introduced by [10732], where destroying a panel that includes (already) destroyed controls produces an error. This is critical because the bug triggers when destroying a map that includes a panel.

Attachments

test-2864.diff Download (0.9 KB) - added by erilem 3 years ago.
test demonstrating the bug
patch-2864-A0.diff Download (0.6 KB) - added by erilem 3 years ago.
patch-test-2864.patch Download (1.5 KB) - added by jorix 3 years ago.
SVN 10810
openlayers-2864.patch Download (2.1 KB) - added by ahocevar 3 years ago.

Change History

Changed 3 years ago by erilem

test demonstrating the bug

Changed 3 years ago by erilem

  Changed 3 years ago by erilem

  • state set to Review

  Changed 3 years ago by erilem

  • cc erilem added

  Changed 3 years ago by fredj

  • state changed from Review to Commit

looks good, please commit

follow-up: ↓ 5   Changed 3 years ago by jorix

Had yet to send the same bug, I think it is better to change "destroy" from "control.js" putting:
this.active = null.
This rearrange future incidents similar.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 3 years ago by erilem

Replying to jorix:

Had yet to send the same bug, I think it is better to change "destroy" from "control.js" putting:
this.active = null.
This rearrange future incidents similar.

jorix, please provide a patch, I'm failing to understand what you're suggesting. Thanks.

Changed 3 years ago by jorix

SVN 10810

in reply to: ↑ 5   Changed 3 years ago by jorix

Replying to erilem:

Replying to jorix: ... jorix, please provide a patch, I'm failing to understand what you're suggesting. Thanks.

I wrote fast and my English is not good.

I added patch based on r10810.
Becomes "this.active = null;" in the destruction of control.

I have seen that there are some controls that are deactivated by the destruction and there is comment

this.deactivate(); // TODO: this should be handled by the super

(see Split.js and Snapping.js)
I understand that in the future in the destruction of a control is also deactivated. For this reason and because it only runs once I think better this option.

  Changed 3 years ago by jorix

there is another reason, the test:

control.activate();
control.destroy();
t.eq(control.deactivate(), false, "control destroyed can not be deactivated.");

fails.


And I think it would be nice if

t.eq(control.activate(), false, "control destroyed can not be activated.");

did not cause an error, as now, but this would be another patch.

  Changed 3 years ago by ahocevar

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

  Changed 3 years ago by ahocevar

  • status changed from closed to reopened
  • state changed from Complete to Needs More Work
  • resolution fixed deleted

r10810 does not resolve the issue. I'm looking at the patch that jorix has provided now.

  Changed 3 years ago by ahocevar

  • owner set to ahocevar
  • status changed from reopened to new

jorix's patch also does not solve the issue. I am investigating this now, but if it takes more than 15 minutes to find a solution, then we should really consider to revert r10732.

  Changed 3 years ago by ahocevar

  • state changed from Needs More Work to Review

The above patch reverts r10810 and partially reverts r10732. It fixes the deactivate problem of #2835 by calling redraw. The remaining destroy issue in #2835 is a duplicate of #2210 and should be handled there.

All tests still pass. Thanks for any review.

Changed 3 years ago by ahocevar

  Changed 3 years ago by erilem

  • state changed from Review to Commit

This totally makes sense. Please commit.

  Changed 3 years ago by ahocevar

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

  Changed 3 years ago by jorix

  • cc xavier.mamano@… added
Note: See TracTickets for help on using tickets.