File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class Search {
3333 private text : Clutter . Text ;
3434 private widgets : Array < St . Widget > ;
3535 private scroller : St . Widget ;
36+ private children_to_abandon : any = null ;
3637
3738 activate_id : ( index : number ) => void = ( ) => { }
3839 cancel : ( ) => void = ( ) => { }
@@ -193,8 +194,7 @@ export class Search {
193194 }
194195
195196 clear ( ) {
196- this . list . remove_all_children ( ) ;
197- this . list . hide ( ) ;
197+ this . children_to_abandon = ( this . list as any ) . get_children ( ) ;
198198 this . widgets = [ ] ;
199199 this . active_id = 0 ;
200200 }
@@ -299,6 +299,14 @@ export class Search {
299299
300300 this . widgets . push ( widget ) ;
301301 this . list . add ( widget ) ;
302+
303+ if ( this . children_to_abandon ) {
304+ for ( const child of this . children_to_abandon ) {
305+ child . destroy ( ) ;
306+ }
307+ this . children_to_abandon = null
308+ }
309+
302310 this . list . show ( ) ;
303311
304312 const vscroll = ( this . scroller as any ) . get_vscroll_bar ( )
You can’t perform that action at this time.
0 commit comments