aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/win.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-07-15 23:17:24 +0200
committerBoris Faure <billiob@gmail.com>2015-07-15 23:20:02 +0200
commit5db007e5798b7f8dd142ea365a6a1ce3333acf82 (patch)
tree5e04ca3cbe1e500b0365a07e3f6afa88d3b5ce3c /src/bin/win.c
parentescapes: pretty-print some escapse and avoid ESC in debug logs (diff)
downloadterminology-5db007e5798b7f8dd142ea365a6a1ce3333acf82.tar.gz
fix segv when spliting from controls. Closes https://phab.enlightenment.org/T2568
Diffstat (limited to 'src/bin/win.c')
-rw-r--r--src/bin/win.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 5094d69..a17643c 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -346,6 +346,9 @@ _solo_focus(Term_Container *tc, Term_Container *relative)
solo = (Solo*) tc;
term = solo->term;
+ if (!tc->parent)
+ return;
+
DBG("tc:%p tc->is_focused:%d from_parent:%d",
tc, tc->is_focused, tc->parent == relative);
if (tc->is_focused)
@@ -1288,6 +1291,10 @@ _split_focus(Term_Container *tc, Term_Container *relative)
DBG("tc:%p tc->is_focused:%d from_parent:%d",
tc, tc->is_focused, tc->parent == relative);
+
+ if (!tc->parent)
+ return;
+
if (tc->parent == relative)
{
tc->is_focused = EINA_TRUE;
@@ -1391,7 +1398,8 @@ _split_split(Term_Container *tc, Term_Container *child,
}
static Term_Container *
-_split_new(Term_Container *tc1, Term_Container *tc2, Eina_Bool is_horizontal)
+_split_new(Term_Container *tc1, Term_Container *tc2,
+ Eina_Bool is_horizontal)
{
Evas_Object *o;
Term_Container *tc = NULL;
@@ -2313,6 +2321,9 @@ _tabs_focus(Term_Container *tc, Term_Container *relative)
assert (tc->type == TERM_CONTAINER_TYPE_TABS);
tabs = (Tabs*) tc;
+ if (!tc->parent)
+ return;
+
DBG("tc:%p tc->is_focused:%d from_parent:%d",
tc, tc->is_focused, tc->parent == relative);
if (tc->parent == relative)
@@ -2360,6 +2371,8 @@ _tabs_unfocus(Term_Container *tc, Term_Container *relative)
tc, tc->is_focused, tc->parent == relative);
if (!tc->is_focused)
return;
+ if (!tc->parent)
+ return;
assert (tc->type == TERM_CONTAINER_TYPE_TABS);
tabs = (Tabs*) tc;