MCPcopy Create free account
hub / github.com/Snapchat/Valdi / doDispose

Method doDispose

valdi/src/valdi/runtime/JavaScript/JSValueRefHolder.cpp:117–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 auto jsValueId = _jsValueId;
116
117 if (jsValueId.isNull()) {
118 return;
119 }
120
121 _jsValueId = JSValueID();
122 jsContext.removedStashedJSValue(jsValueId);
123}
124
125bool JSValueRefHolder::dispose(std::unique_lock<Mutex>& disposablesLock) {
126 return doDispose(disposablesLock);
127}
128
129static void doReleaseJsValue(const Shared<JavaScriptTaskScheduler>& taskScheduler,
130 const Ref<Context>& context,
131 const JSValueID& jsValueId) {
132 taskScheduler->dispatchOnJsThreadAsync(context, [jsValueId](JavaScriptEntryParameters& jsEntry) {
133 jsEntry.jsContext.removedStashedJSValue(jsValueId);
134 });
135}
136
137bool JSValueRefHolder::doDispose(std::unique_lock<Mutex>& disposablesLock) {
138 auto jsValueId = _jsValueId;
139
140 if (jsValueId.isNull()) {

Callers

nothing calls this directly

Calls 4

doReleaseJsValueFunction · 0.85
isNullMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected