git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1978ad5
)
fix stack overflow
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Wed, 23 Aug 2017 01:51:56 +0000
(21:51 -0400)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Wed, 23 Aug 2017 01:51:56 +0000
(21:51 -0400)
src/jexer/TApplication.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jexer/TApplication.java
b/src/jexer/TApplication.java
index 4457197caeec733fbea251085b9105e1ec4e9940..b4c53ec3a5ea8899db40c6dbdda283abe85153f7 100644
(file)
--- a/
src/jexer/TApplication.java
+++ b/
src/jexer/TApplication.java
@@
-1431,9
+1431,15
@@
public class TApplication implements Runnable {
if (activeWindow != null) {
assert (activeWindow.getZ() == 0);
- activeWindow.onUnfocus();
activeWindow.setActive(false);
activeWindow.setZ(window.getZ());
+
+ // Unset activeWindow now before unfocus, so that a window
+ // lifecycle change inside onUnfocus() doesn't call
+ // switchWindow() and lead to a stack overflow.
+ TWindow oldActiveWindow = activeWindow;
+ activeWindow = null;
+ oldActiveWindow.onUnfocus();
}
activeWindow = window;
activeWindow.setZ(0);