| 484 | } |
| 485 | |
| 486 | static void gjs_context_finalize(GObject* object) { |
| 487 | if (gjs_context_get_current() == GJS_CONTEXT(object)) |
| 488 | gjs_context_make_current(nullptr); |
| 489 | |
| 490 | g_mutex_lock(&contexts_lock); |
| 491 | all_contexts = g_list_remove(all_contexts, object); |
| 492 | g_mutex_unlock(&contexts_lock); |
| 493 | |
| 494 | GjsContextPrivate* gjs = GjsContextPrivate::from_object(object); |
| 495 | gjs->~GjsContextPrivate(); |
| 496 | G_OBJECT_CLASS(gjs_context_parent_class)->finalize(object); |
| 497 | |
| 498 | g_mutex_lock(&contexts_lock); |
| 499 | if (!all_contexts) |
| 500 | gjs_log_cleanup(); |
| 501 | g_mutex_unlock(&contexts_lock); |
| 502 | } |
| 503 | |
| 504 | static void gjs_context_constructed(GObject* object) { |
| 505 | GjsContext* self = GJS_CONTEXT(object); |
nothing calls this directly
no test coverage detected