From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3990CBC50 for ; Thu, 24 Aug 2006 16:31:45 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7OEVirW007369 for ; Thu, 24 Aug 2006 16:31:44 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA21160 for ; Thu, 24 Aug 2006 16:31:44 +0200 (MET DST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id k7O8xXCo001018 for ; Thu, 24 Aug 2006 10:59:40 +0200 Received: (qmail 26432 invoked by uid 0); 24 Aug 2006 08:59:33 -0000 Received: from 194.25.187.120 by www109.gmx.net with HTTP; Thu, 24 Aug 2006 10:59:33 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Thu, 24 Aug 2006 10:59:34 +0200 From: "Michael Wohlwend" Message-ID: <20060824085934.198440@gmx.net> MIME-Version: 1.0 Subject: memory handling with native code To: caml-list@inria.fr X-Authenticated: #20477425 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 44EDB850.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44ED6A76.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lib:01 widget:01 ocaml:01 widget:01 ocaml:01 pointer:01 cheers:01 destroyed:98 jetzt:98 implemented:02 native:02 native:02 inherits:03 interface:05 wrap:07 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? cheers, Michael -- "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail