summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-02-28 13:26:59 +0900
committerHermet Park <hermetpark@gmail.com>2019-02-28 13:26:59 +0900
commit60e51fccbe73d9b865c268f4aac51d6ad4771028 (patch)
tree3c715e9867ecc063052ffc80a7f8edc9b1a7d9d0
parent5e87363560e15b497e6705a03cf4e698ac6fb909 (diff)
edc_editor: don't access the danling edit object.
-rw-r--r--src/lib/auto_comp.c21
-rw-r--r--src/lib/edc_editor.c8
2 files changed, 20 insertions, 9 deletions
diff --git a/src/lib/auto_comp.c b/src/lib/auto_comp.c
index 46a89de..e69968c 100644
--- a/src/lib/auto_comp.c
+++ b/src/lib/auto_comp.c
@@ -897,15 +897,18 @@ autocomp_target_set(edit_data *ed)
897 if (ad->ed) 897 if (ad->ed)
898 { 898 {
899 entry = edit_entry_get(ad->ed); 899 entry = edit_entry_get(ad->ed);
900 evas_object_smart_callback_del(entry, "changed,user", entry_changed_cb); 900 if (entry)
901 evas_object_smart_callback_del(entry, "cursor,changed", 901 {
902 entry_cursor_changed_cb); 902 evas_object_smart_callback_del(entry, "changed,user", entry_changed_cb);
903 evas_object_smart_callback_del(entry, "cursor,changed,manual", 903 evas_object_smart_callback_del(entry, "cursor,changed",
904 entry_cursor_changed_manual_cb); 904 entry_cursor_changed_cb);
905 evas_object_smart_callback_del(entry, "unfocused", anchor_unfocused_cb); 905 evas_object_smart_callback_del(entry, "cursor,changed,manual",
906 evas_object_smart_callback_del(entry, "press", entry_press_cb); 906 entry_cursor_changed_manual_cb);
907 evas_object_event_callback_del(entry, EVAS_CALLBACK_MOVE, 907 evas_object_smart_callback_del(entry, "unfocused", anchor_unfocused_cb);
908 entry_move_cb); 908 evas_object_smart_callback_del(entry, "press", entry_press_cb);
909 evas_object_event_callback_del(entry, EVAS_CALLBACK_MOVE,
910 entry_move_cb);
911 }
909 evas_object_del(ad->anchor); 912 evas_object_del(ad->anchor);
910 ad->anchor = NULL; 913 ad->anchor = NULL;
911 ad->ed = NULL; 914 ad->ed = NULL;
diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index ee15a94..4fc888b 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -1480,6 +1480,13 @@ edit_cur_indent_depth_get(edit_data *ed)
1480 return indent_space_get(syntax_indent_data_get(ed->sh)); 1480 return indent_space_get(syntax_indent_data_get(ed->sh));
1481} 1481}
1482 1482
1483static void
1484edit_obj_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
1485{
1486 edit_data *ed = data;
1487 ed->en_edit = NULL;
1488}
1489
1483edit_data * 1490edit_data *
1484edit_init(Enventor_Object *enventor, Enventor_Item *it) 1491edit_init(Enventor_Object *enventor, Enventor_Item *it)
1485{ 1492{
@@ -1571,6 +1578,7 @@ edit_init(Enventor_Object *enventor, Enventor_Item *it)
1571 edit_selection_cleared_cb, ed); 1578 edit_selection_cleared_cb, ed);
1572 evas_object_smart_callback_add(en_edit, "selection,start", 1579 evas_object_smart_callback_add(en_edit, "selection,start",
1573 edit_selection_start_cb, ed); 1580 edit_selection_start_cb, ed);
1581 evas_object_event_callback_add(en_edit, EVAS_CALLBACK_DEL, edit_obj_del_cb, ed);
1574 evas_object_size_hint_weight_set(en_edit, EVAS_HINT_EXPAND, 1582 evas_object_size_hint_weight_set(en_edit, EVAS_HINT_EXPAND,
1575 EVAS_HINT_EXPAND); 1583 EVAS_HINT_EXPAND);
1576 evas_object_size_hint_align_set(en_edit, EVAS_HINT_FILL, EVAS_HINT_FILL); 1584 evas_object_size_hint_align_set(en_edit, EVAS_HINT_FILL, EVAS_HINT_FILL);