MCPcopy Create free account
hub / github.com/GNOME/gjs / gjs_context_dispose

Function gjs_context_dispose

gjs/context.cpp:370–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370static void gjs_context_dispose(GObject* object) {
371 gjs_debug(GJS_DEBUG_CONTEXT, "JS shutdown sequence");
372
373 GjsContextPrivate* gjs = GjsContextPrivate::from_object(object);
374
375 g_assert(gjs->is_owner_thread() &&
376 "Gjs Context disposed from another thread");
377
378 // Profiler must be stopped and freed before context is shut down
379 gjs->free_profiler();
380
381 /* Stop accepting entries in the toggle queue before running dispose
382 * notifications, which causes all GjsMaybeOwned instances to unroot. We
383 * don't want any objects to toggle down after that. */
384 gjs_debug(GJS_DEBUG_CONTEXT, "Shutting down toggle queue");
385 gjs_object_clear_toggles();
386 gjs_object_shutdown_toggle_queue();
387
388 if (gjs->context())
389 ObjectInstance::context_dispose_notify(nullptr, object);
390
391 gjs_debug(GJS_DEBUG_CONTEXT,
392 "Notifying external reference holders of GjsContext dispose");
393 G_OBJECT_CLASS(gjs_context_parent_class)->dispose(object);
394
395 gjs->dispose();
396}
397
398void GjsContextPrivate::free_profiler() {
399 gjs_debug(GJS_DEBUG_CONTEXT, "Stopping profiler");

Callers

nothing calls this directly

Calls 7

gjs_debugFunction · 0.85
gjs_object_clear_togglesFunction · 0.85
is_owner_threadMethod · 0.80
free_profilerMethod · 0.80
contextMethod · 0.80
disposeMethod · 0.45

Tested by

no test coverage detected