1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 15:54:11 +01:00

Fix overlong stack generated by key events received during feedkeys, along with related "Attempt to execute mapping recursively" errors.

This commit is contained in:
Kris Maglione
2011-01-20 00:30:14 -05:00
parent 8df4e908e8
commit 8fbe8fffec
2 changed files with 59 additions and 48 deletions

View File

@@ -1465,16 +1465,23 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return results;
},
yielders: 0,
threadYield: function (flush, interruptable) {
let mainThread = services.threading.mainThread;
/* FIXME */
util.interrupted = false;
do {
mainThread.processNextEvent(!flush);
if (util.interrupted)
throw new Error("Interrupted");
this.yielders++;
try {
let mainThread = services.threading.mainThread;
/* FIXME */
util.interrupted = false;
do {
mainThread.processNextEvent(!flush);
if (util.interrupted)
throw new Error("Interrupted");
}
while (flush === true && mainThread.hasPendingEvents());
}
finally {
this.yielders--;
}
while (flush === true && mainThread.hasPendingEvents());
},
yieldable: function yieldable(func)