Skip to content

Commit

Permalink
Add DeleteWrapperProxyHandler (servo#470)
Browse files Browse the repository at this point in the history
* Add DeleteWrapperProxyHandler

This function is needed to be able to release the memory allocated by CreateWrapperProxyHandler from Rust after use.

* Bump mozjs-sys version after adding C++ DeleteWrapperProxyHandler
  • Loading branch information
ede1998 committed Jul 2, 2024
1 parent 98bc065 commit 7fe4fa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mozjs-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mozjs_sys"
description = "System crate for the Mozilla SpiderMonkey JavaScript engine."
repository.workspace = true
version = "0.115.13-0"
version = "0.115.13-1"
authors = ["Mozilla"]
links = "mozjs"
build = "build.rs"
Expand Down
4 changes: 4 additions & 0 deletions mozjs-sys/src/jsglue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ const void* CreateWrapperProxyHandler(const ProxyTraps* aTraps) {
return new WrapperProxyHandler(*aTraps);
}

void DeleteWrapperProxyHandler(const void* handler) {
delete static_cast<const WrapperProxyHandler*>(handler);
}

const void* GetCrossCompartmentWrapper() {
return &js::CrossCompartmentWrapper::singleton;
}
Expand Down

0 comments on commit 7fe4fa2

Please sign in to comment.