Page MenuHomePhabricator

csharp: Fix free_cb calling under dotnet.
ClosedPublic

Authored by lauromoura on Apr 10 2019, 6:01 PM.

Details

Summary

dotnet's GC seems to be more agressive, showing some issues that usually
do not appear when running under Mono's.

This commit uses for free_cb's the same scheme we already use for
regular Eo refs, using a GC handle to keep the cleaning callback alive.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lauromoura created this revision.Apr 10 2019, 6:01 PM
lauromoura requested review of this revision.Apr 10 2019, 6:01 PM
vitor.sousa requested changes to this revision.Apr 11 2019, 12:35 PM

Very nice.
Some comments:

src/bindings/mono/eo_mono/iwrapper.cs
712–717

If the if above is false, then this handle will leak.
Maybe move this code inside the if scope?

src/lib/efl_mono/efl_custom_exports_mono.c
82 ↗(On Diff #21310)

I think this added level of indirection in C may be unnecessary, since we already have a lambda able of capturing every context need in C#.
But that would require some testing to check if it is really the case.

This revision now requires changes to proceed.Apr 11 2019, 12:35 PM
vitor.sousa added inline comments.Apr 11 2019, 12:38 PM
src/bindings/mono/eo_mono/iwrapper.cs
712–717

below* (facepalm)

lauromoura updated this revision to Diff 21352.Apr 15 2019, 7:12 AM

Update after vitor comments

vitor.sousa accepted this revision.Apr 15 2019, 10:45 AM
This revision is now accepted and ready to land.Apr 15 2019, 10:45 AM
This revision was automatically updated to reflect the committed changes.