`post_instantiate` is morally equivalent to duplicating the display object it's called on, so we should also duplicate the XML document attached to it.

We don't have to do this for `object` because we don't actually construct the script object until instantiation time.
This commit is contained in:
David Wendt 2020-01-24 23:52:40 -05:00
parent a3f4509d63
commit 7e7ca88c3d
1 changed files with 6 additions and 0 deletions

View File

@ -476,6 +476,12 @@ impl<'gc> TDisplayObject<'gc> for EditText<'gc> {
text.object = Some(object);
}
text.document = text
.document
.as_node()
.duplicate(context.gc_context, true)
.document();
}
fn object(&self) -> Value<'gc> {