summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-04-05 19:59:34 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-04-05 19:59:47 -0300
commit7c28762f15f9935d5ca08ef87ee7ddfaf1df4815 (patch)
tree3b602d7fb867e91c202f262b7aaa215c8245856b /src/tests/efl_mono
parent1c22a3d8190fd85570418a076356547f3eda606f (diff)
efl-csharp: fix crash when events trigger after C# object `Dispose`
Summary: Rework general event handling to check individually each event call, if the object is not alive then the event will not be propagated. WeakReferences (and lambdas capturing those WeakRefs) are used to ensure this. Dispose methods in object now take care of checking if efl libraries are still initialized and thread-safely unregister each event before performing an efl_unref on the Eo object. Event handling in C# is now centered around a single dictionary inside the object: `EoEvents`. C# event triggers now properly trigger events on C too. Standardize C# event-triggering methods names (remove underscores). Some diminished use of static memory due events no longer requiring static key objects to be registered/unregistered. Some fixing of white space generation for generated events. Depends on D8431 Reviewers: lauromoura, felipealmeida, segfaultxavi Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8564
Diffstat (limited to 'src/tests/efl_mono')
-rw-r--r--src/tests/efl_mono/Eo.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index f4e3f5d51f..e77fd7bbc7 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -49,6 +49,7 @@ class TestEo
49 Test.Assert(delEventCalled, "DEL event not called"); 49 Test.Assert(delEventCalled, "DEL event not called");
50 } */ 50 } */
51 51
52 /* Commented until we figure out a new way to test disposing
52 public static void dispose_really_frees() 53 public static void dispose_really_frees()
53 { 54 {
54 bool delEventCalled = false; 55 bool delEventCalled = false;
@@ -62,6 +63,7 @@ class TestEo
62 63
63 Test.Assert(delEventCalled, "DEL event not called"); 64 Test.Assert(delEventCalled, "DEL event not called");
64 } 65 }
66 */
65 67
66 /* Commented out as adding the event listener seems to prevent it from being GC'd. 68 /* Commented out as adding the event listener seems to prevent it from being GC'd.
67 public static void derived_destructor_really_frees() 69 public static void derived_destructor_really_frees()