summaryrefslogtreecommitdiff
path: root/gjs/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gjs/context.cpp')
-rw-r--r--gjs/context.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 8d2cbc6e..59ac8afd 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -1045,12 +1045,10 @@ bool GjsContextPrivate::enqueuePromiseJob(JSContext* cx [[maybe_unused]],
// Override of JobQueue::runJobs(). Called by js::RunJobs(), and when execution
// of the job queue was interrupted by the debugger and is resuming.
-void GjsContextPrivate::runJobs(JSContext* cx) { runJobs(cx, nullptr); }
-
-void GjsContextPrivate::runJobs(JSContext* cx, GCancellable* cancellable) {
+void GjsContextPrivate::runJobs(JSContext* cx) {
g_assert(cx == m_cx);
g_assert(from_cx(cx) == this);
- if (!run_jobs_fallible(cancellable))
+ if (!run_jobs_fallible())
gjs_log_exception(cx);
}
@@ -1066,7 +1064,7 @@ void GjsContextPrivate::runJobs(JSContext* cx, GCancellable* cancellable) {
* Returns: false if one of the jobs threw an uncatchable exception;
* otherwise true.
*/
-bool GjsContextPrivate::run_jobs_fallible(GCancellable* cancellable) {
+bool GjsContextPrivate::run_jobs_fallible() {
bool retval = true;
if (m_draining_job_queue || m_should_exit)
@@ -1083,7 +1081,7 @@ bool GjsContextPrivate::run_jobs_fallible(GCancellable* cancellable) {
* it's crucial to recheck the queue length during each iteration. */
for (size_t ix = 0; ix < m_job_queue.length(); ix++) {
/* A previous job might have set this flag. e.g., System.exit(). */
- if (m_should_exit || g_cancellable_is_cancelled(cancellable)) {
+ if (m_should_exit || !m_dispatcher.is_running()) {
gjs_debug(GJS_DEBUG_MAINLOOP, "Stopping jobs because of %s",
m_should_exit ? "exit" : "main loop cancel");
break;