caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Michael Wohlwend <micha-1@fantasymail.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] memory handling with native code
Date: Fri, 25 Aug 2006 01:46:25 +1000	[thread overview]
Message-ID: <1156434385.20759.24.camel@rosella.wigram> (raw)
In-Reply-To: <20060824085934.198440@gmx.net>

On Thu, 2006-08-24 at 10:59 +0200, Michael Wohlwend wrote:

FYI: your email client is not correctly formatting email.
It allows paragraphs to consist of one long line. The email RFC
does not allow this. Please line break manually, around 60 characters.

My client  line-breaks your text on reading, but it does not do so in 
quotations ;(

> 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? 

You can use a finaliser. Look in the Gc module.
This ensures the object is not deleted whilst the Ocaml
object remains reachable. The finaliser is ordinary
Ocaml code, which can call a C routine to do the deletion.
You don't need a custom block for this, but you do need
to wrap the constructor/binder logic to ensure the
Ocaml finaliser is applied to the object.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2006-08-24 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24  8:59 Michael Wohlwend
2006-08-24 15:46 ` skaller [this message]
2006-08-24 16:47 ` Bardur Arantsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1156434385.20759.24.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=micha-1@fantasymail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).