This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Fix JavaScript error when closing stack window in HTML5 standalone
Original file line number Diff line number Diff line change @@ -135,14 +135,12 @@ mergeInto(LibraryManager.library, {
135135 } ,
136136
137137 destroyWindow : function ( pID ) {
138- LiveCodeDC . setWindowVisible ( pID , false ) ;
139- LiveCodeDC . raiseWindow ( pID ) ;
140138 var window = LiveCodeUtil . fetchObject ( pID ) ;
141139 if ( window )
142140 {
143- window . element . removeChild ( window . container . element ) ;
144141 LiveCodeDC . _removeResizeMonitor ( window . canvas ) ;
145-
142+ LiveCodeDC . setWindowVisible ( pID , false ) ;
143+
146144 if ( window . mainWindow )
147145 {
148146 // TODO - handle cleanup of embedded canvas
@@ -332,9 +330,13 @@ mergeInto(LibraryManager.library, {
332330
333331 _removeResizeMonitor : function ( element ) {
334332 if ( LiveCodeDC . _monitorResize . watched ) {
335- var index = LiveCodeDC . _monitorResize . watched . indexOf ( element ) ;
336- if ( index !== - 1 ) {
337- LiveCodeDC . _monitorResize . watched . splice ( index , 1 ) ;
333+ var index = 0 ;
334+ while ( index < LiveCodeDC . _monitorResize . watched . length )
335+ {
336+ if ( LiveCodeDC . _monitorResize . watched [ index ] . element === element )
337+ LiveCodeDC . _monitorResize . watched . splice ( index , 1 ) ;
338+ else
339+ index ++ ;
338340 }
339341 }
340342 } ,
You can’t perform that action at this time.
0 commit comments