Popup("destroy") never ends #5244

Closed
DzenisevichK opened this Issue Nov 2, 2012 · 2 comments

Projects

None yet

2 participants

@DzenisevichK

Test case:

http://jsbin.com/epowaq/7

Steps:

  • Click on "Open Popup"
  • Close popup - you will entered in "popup._destroy -> container.remove -> cleanData -> popup._destroy" loop that never ends.

Final results on different platforms:

  • ~1 min hung and then stack execution timeout on
    • (mobile Safari on iOS 4.3.3),
    • (mobile Safari on iOS 6),
  • ~3 sec hung on
    • (Chrome 22.0.1229.94 m on Windows 7 SP1 x64)
    • (IE9 on Windows 7 SP1 x64)
    • (Safari 5.1.7 on Windows 7 SP1 x64)

Related issue #5150

@gabrielschulhof
Contributor

Good catch! If the payload element is not initially attached to the DOM, there's no place to put it back, so it stays inside the container. I shall have to detach() it and then remove the container.

@gabrielschulhof gabrielschulhof added a commit that closed this issue Nov 2, 2012
@gabrielschulhof gabrielschulhof [popup] Avoid infinite recursion by detach()ing the payload from the …
…container before attempting to put it back to its original place in the DOM (which may not exist, if the popup was created based on a detached element) -- Fixes #5244
8199f24
@DzenisevichK

@gabrielschulhof

Great! Thanks a lot!

@gabrielschulhof gabrielschulhof added a commit that referenced this issue Nov 2, 2012
@gabrielschulhof gabrielschulhof [popup] Avoid infinite recursion by detach()ing the payload from the …
…container before attempting to put it back to its original place in the DOM (which may not exist, if the popup was created based on a detached element) -- Fixes #5244

Conflicts:

	js/widgets/popup.js
1c5f7ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment