C++ interop; object destruction

Manu via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 22 20:51:46 PDT 2017


On 23 June 2017 at 10:52, Nicholas Wilson via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Friday, 23 June 2017 at 00:33:55 UTC, Manu wrote:
>
>> On 23 June 2017 at 09:32, Nicholas Wilson via Digitalmars-d <
>> digitalmars-d at puremagic.com> wrote:
>>
>> On Thursday, 22 June 2017 at 12:52:26 UTC, Manu wrote:
>>>
>>> How do I properly implement object destruction of extern(C++) classes
>>>> (with
>>>> virtual destructors)?
>>>>
>>>> [...]
>>>>
>>>>
>>> Also didn't Ethan come up with a solution for this for Binderoo?
>>>
>>>
>> I'm not sure...
>>
>
> I'm pretty sure he manually constructs the vtbl and inserts the virtual
> function into it, so it should just be a case of calling the virtual
> destructor.
>
> Have a look at this DConf 2017 talk.
>

I do that, but that doesn't mean the destructors work. object.destroy()
just crashes.

Believe me, I've been messing with this a lot. The answer to this email is
some code that satisfies the criteria, I've tried a lot of things.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20170623/9d87cc78/attachment-0001.html>


More information about the Digitalmars-d mailing list