Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
memory handling with native code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-24 (14:31)
From: Michael Wohlwend <micha-1@f...>
Subject: memory handling with native code
I'm trying to make an interface to a c++ lib of a friend of me, it's getting better, but questions about the memory management came up:

Say there is a c++ class widget, which I want to mirror on the ocaml side. So I implemented a c++ widget-adapter, which inherits from widget and forwards events to the ocaml widget class. This works fine, but how to delete the widget adapter? In the case the ocaml class gets destroyed by the gc the adapter on the native side is still there.
Should I wrap the pointer in a custom object?



"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: