core: Clear masker/maskee properties when unloading objects
This commit is contained in:
parent
b586c7f74e
commit
0d98fe8b7c
|
@ -990,6 +990,12 @@ pub trait TDisplayObject<'gc>:
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(node) = self.maskee() {
|
||||
node.set_masker(context.gc_context, None, true);
|
||||
} else if let Some(node) = self.masker() {
|
||||
node.set_maskee(context.gc_context, None, true);
|
||||
}
|
||||
|
||||
// Unregister any text field variable bindings, and replace them on the unbound list.
|
||||
if let Avm1Value::Object(object) = self.object() {
|
||||
if let Some(stage_object) = object.as_stage_object() {
|
||||
|
|
|
@ -517,6 +517,11 @@ impl<'gc> TDisplayObject<'gc> for Button<'gc> {
|
|||
let tracker = context.focus_tracker;
|
||||
tracker.set(None, context);
|
||||
}
|
||||
if let Some(node) = self.maskee() {
|
||||
node.set_masker(context.gc_context, None, true);
|
||||
} else if let Some(node) = self.masker() {
|
||||
node.set_maskee(context.gc_context, None, true);
|
||||
}
|
||||
self.set_removed(context.gc_context, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1500,6 +1500,12 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> {
|
|||
tracker.set(None, context);
|
||||
}
|
||||
|
||||
if let Some(node) = self.maskee() {
|
||||
node.set_masker(context.gc_context, None, true);
|
||||
} else if let Some(node) = self.masker() {
|
||||
node.set_maskee(context.gc_context, None, true);
|
||||
}
|
||||
|
||||
// Unbind any display objects bound to this text.
|
||||
if let Some(stage_object) = self.0.write(context.gc_context).bound_stage_object.take() {
|
||||
stage_object.clear_text_field_binding(context.gc_context, *self);
|
||||
|
|
|
@ -1987,6 +1987,12 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
|
|||
child.unload(context);
|
||||
}
|
||||
|
||||
if let Some(node) = self.maskee() {
|
||||
node.set_masker(context.gc_context, None, true);
|
||||
} else if let Some(node) = self.masker() {
|
||||
node.set_maskee(context.gc_context, None, true);
|
||||
}
|
||||
|
||||
// Unregister any text field variable bindings.
|
||||
if let Avm1Value::Object(object) = self.object() {
|
||||
if let Some(stage_object) = object.as_stage_object() {
|
||||
|
|
Loading…
Reference in New Issue