On Wednesday, June 23rd, 2021 at 3:53 PM, Andreas Volz <li...@brachttal.net> 
wrote:
> Am 23.06.21 um 18:02 schrieb Cedric Bail:
> > On Tuesday, June 22nd, 2021 at 11:36 PM, Andreas Volz li...@brachttal.net 
> > wrote:
> > > Hello together,
> > 

> > > after some waiting time I would like to ask here if some other user
> > > could at least verify the same crash with C++ API that I described here:
> > 

> > > https://phab.enlightenment.org/T8943
> > 

> > > If I'm not strongly misusing the API than it's a very basic error. Just
> > > loading an Edje file into a Layout.
> > 

> > I vaguely remember discussion about this issue. I don't think we actually 
> > support function pointer in auto generated code, except for eo callback 
> > mechanism, due to some memory lifecycle uncertainty. And it kind of match 
> > what your bug report says.
> > 

> > > Would be good to know someone else does see the same.
> > > Do you know a workaround to come around this? Maybe use another C++
> > > compatible API / mix with C API to continue work on my application?
> > > regards
> > 

> > I remember that the workaround would be to switch to use the C API instead 
> > of the C++ one as I think we do have a smart pointer trick that allow you 
> > to directly use the C pointer and C function from the C++ object.
> 

> To make it explicit as question. You suggest to not use the C++ API at
> all in my application or just not for this use case?

Not use the C++ API that does take a function as a parameter except for
efl_event.

> Is it a good idea to mix usage of C and C++ API as long as it's not
> fully stable and then adapt later to full C++ usage? Do you know an
> example how to access the C API object?

The C++ API is header only, directly use the C API under it and the
this pointer of a C++ object is actually the Eo* resulting in no
overhead and no ABI in using the C++ binding. It does also means you
can safely go from C to C++ and back. When I played with it last time
you could just pass a C++ Eo object to a C function and the cast
would be done magically. If it isn't done magically anymore, I think
there is a _eo_ref() on the C++ object to get the Eo* pointer.

Cedric

Attachment: publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to