[gjs/ewlsh/workers-api: 123/124] Ensure context is provided




commit 8e3acf85856c9addd1c0b6bca27319a054f3cba5
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Mar 25 18:44:15 2022 -0700

    Ensure context is provided

 modules/esm/_timers.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/modules/esm/_timers.js b/modules/esm/_timers.js
index 1797eaedb..c8fd992f3 100644
--- a/modules/esm/_timers.js
+++ b/modules/esm/_timers.js
@@ -26,7 +26,7 @@ const timeouts = new Map();
  * @param {GLib.Source} source the source to add to our map
  */
 function addSource(source) {
-    const context = GLib.MainContext.get_thread_default() ?? null;
+    const context = GLib.MainContext.get_thread_default() ?? GLib.MainContext.default();
     if (!context)
         throw new Error('No context available');
     const id = source.attach(context);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]