summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-09-05 14:25:11 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-09-05 14:47:19 -0300
commit4c53151096cf0e4e9e0f451b9d90ec0848aadd36 (patch)
tree7b8b95fe99aa15bb7bdf21ca57da7bd595444502 /src/bin/eolian_mono
parent5e107aa19dc944e38624a0fa5a61a54db7f8035c (diff)
efl-csharp: Fix event callback removal.
Summary: Use the native event loaded from dlsym directly instead of wrapping it in a Event_Description structure. Fixes: T7355 Reviewers: felipealmeida, vitor.sousa, segfaultxavi Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D6981
Diffstat (limited to 'src/bin/eolian_mono')
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 4eea1e852f..ef2c58f757 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -484,7 +484,11 @@ struct klass
484 << scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n" 484 << scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n"
485 << scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n" 485 << scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n"
486 << scope_tab << scope_tab << "if (event_count == 0) {\n" 486 << scope_tab << scope_tab << "if (event_count == 0) {\n"
487 << scope_tab << scope_tab << scope_tab << "IntPtr desc = efl.eo.Globals.dlsym(efl.eo.Globals.RTLD_DEFAULT, key);\n" 487 << scope_tab << scope_tab << scope_tab << "IntPtr desc = efl.Event_Description.GetNative(key);\n"
488 << scope_tab << scope_tab << scope_tab << "if (desc == IntPtr.Zero) {\n"
489 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to get native event {key}\");\n"
490 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
491 << scope_tab << scope_tab << scope_tab << "}\n"
488 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);\n" 492 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);\n"
489 << scope_tab << scope_tab << scope_tab << "if (!result) {\n" 493 << scope_tab << scope_tab << scope_tab << "if (!result) {\n"
490 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to add event proxy for event {key}\");\n" 494 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to add event proxy for event {key}\");\n"
@@ -500,7 +504,11 @@ struct klass
500 << scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n" 504 << scope_tab << scope_tab << "if (!event_cb_count.TryGetValue(key, out event_count))\n"
501 << scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n" 505 << scope_tab << scope_tab << scope_tab << "event_cb_count[key] = event_count;\n"
502 << scope_tab << scope_tab << "if (event_count == 1) {\n" 506 << scope_tab << scope_tab << "if (event_count == 1) {\n"
503 << scope_tab << scope_tab << scope_tab << "efl.Event_Description desc = new efl.Event_Description(key);\n" 507 << scope_tab << scope_tab << scope_tab << "IntPtr desc = efl.Event_Description.GetNative(key);\n"
508 << scope_tab << scope_tab << scope_tab << "if (desc == IntPtr.Zero) {\n"
509 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to get native event {key}\");\n"
510 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
511 << scope_tab << scope_tab << scope_tab << "}\n"
504 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);\n" 512 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);\n"
505 << scope_tab << scope_tab << scope_tab << "if (!result) {\n" 513 << scope_tab << scope_tab << scope_tab << "if (!result) {\n"
506 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n" 514 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n"