mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fix crash when closing window containing video element (#31413)
* Forbid casting DOM objects when JS runtime is shutting down. * Remove media controls from document when element is removed from the tree.
This commit is contained in:
parent
e078a99817
commit
b182bdfa52
3 changed files with 15 additions and 2 deletions
|
@ -812,6 +812,10 @@ thread_local!(
|
|||
static THREAD_ACTIVE: Cell<bool> = Cell::new(true);
|
||||
);
|
||||
|
||||
pub(crate) fn runtime_is_alive() -> bool {
|
||||
THREAD_ACTIVE.with(|t| t.get())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe extern "C" fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_void) {
|
||||
if !THREAD_ACTIVE.with(|t| t.get()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue