File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ const VSKNode = (name: string) => {
64
64
instance . _ssw_id = (
65
65
parent as ComponentInternalInstanceWithSoftSkiaWASM
66
66
) . _ssw_id ;
67
+ instance . _ssw_attached = true ;
67
68
68
69
instance . _ssw_grouped = ( child ) => {
69
70
core . setAttrBySerde ( instance . _ssw_id , {
@@ -103,6 +104,7 @@ const VSKNode = (name: string) => {
103
104
}
104
105
const core = root . ssw ;
105
106
instance . _ssw_id = SelfIncreaseCount . count ;
107
+ instance . _ssw_attached = true ;
106
108
var parent = instance . parent ;
107
109
while ( ! ( '_ssw_id' in parent ) ) {
108
110
parent = parent . parent ;
@@ -208,7 +210,10 @@ const VSKNode = (name: string) => {
208
210
while ( ! ( '_ssw_id' in parent ) ) {
209
211
parent = parent . parent ;
210
212
}
211
- core . removeChildFromContainer ( child_id , ( parent as ComponentInternalInstanceWithSoftSkiaWASM ) . _ssw_id )
213
+ instance . _ssw_attached = false ;
214
+ if ( ( parent as ComponentInternalInstanceWithSoftSkiaWASM ) . _ssw_attached && parent . isMounted ) {
215
+ core . removeChildFromContainer ( child_id , ( parent as ComponentInternalInstanceWithSoftSkiaWASM ) . _ssw_id )
216
+ }
212
217
} ) ;
213
218
214
219
return ( ) => h ( name , { } , slots . default ?.( ) )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { SoftSkiaWASM } from '../soft-skia-wasm/pkg/';
6
6
export type ComponentInternalInstanceWithSoftSkiaWASM = ComponentInternalInstance & {
7
7
ssw : SoftSkiaWASM ;
8
8
_ssw_id : number ;
9
+ _ssw_attached : boolean ;
9
10
_ssw_grouped ?: ( instance : ComponentInternalInstanceWithSoftSkiaWASM ) => void ;
10
11
_ssw_batchDraw ?: ( ) => void ;
11
12
}
You can’t perform that action at this time.
0 commit comments