caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Cannasse" <warplayer@free.fr>
To: "kyra" <kyrab@mail.ru>, "OCaml" <caml-list@inria.fr>
Subject: Re: [Caml-list] OCam'OLE pre-release
Date: Fri, 2 Aug 2002 12:13:01 +0200	[thread overview]
Message-ID: <001101c23a0d$2f184220$0700a8c0@warp> (raw)
In-Reply-To: <001901c239b4$be8ccbf0$551aa8c0@kyra>

 > But I must point out typical error (I saw exactly the same error in
Haskell
> HDirect/COM library): ocaml finalization and com release are _essentially
> different_ entities! Sorry for not being sufficiently verbose - i have not
> enough time right now. If You doubt this is an issue - I will definitely
> clarify my point.

Yes, i would actually ear your arguments about that point, because it does
not seems clear to me : the AddRef/Release semantic of COM is a reference
counting to enable the sharing of object and thus determine its time-life
 the last Release() call will trigger effective memory release of the
object ).

For OLE , Release() doesn't not close the Application if it has been put
Visible to the user, but CoUninitiliaze will break the DDE and close it.
That's why i added the primitive "do_not_close" which prevent CoUninitialize
from being called, to enable Applications to remains open even if the ocaml
exit.

> Now only a few words: I've built native olegen version
> (having replaced CoInitialize/CoUninitialize call in DllMain with a call
in
> a static dummy class instance constructor/destructor), and discovered this
> olegen causes segmentaion fault! It turned out to be sufficient simply to
> comment out "i->Release();" in "com_finalize" to make it work.

That behavior should be explained by the following : Release() is called by
the GC, and OCamole perform a full_major cycle on "at_exit" of OCaml. But if
you call CoUnitialize perform having all the COM objects being properly
Released, it can freeze, or simply go on... but then a call to Release()
will cause a seg_fault.

Simply modify ocamole in order to not call "i->Release()" if CoUninitialize
had been made, or ( better ) GC'd all your COM objects before calling
ComUninit.

Nicolas Cannasse


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-08-02 10:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-30 19:19 Nicolas Cannasse
2002-07-31 12:06 ` [Caml-list] OCam'OLE pre-release (mirror) Nicolas Cannasse
2002-07-31 12:48   ` Samuel Lacas
2002-07-31 13:13     ` Nicolas Cannasse
2002-07-31 13:30       ` Samuel Lacas
2002-08-01 23:39 ` [Caml-list] OCam'OLE pre-release kyra
2002-08-02 10:13   ` Nicolas Cannasse [this message]
2002-08-02 23:26     ` kyra
2002-08-02 23:23       ` Quetzalcoatl Bradley
2002-08-04 12:00         ` kyra
2002-08-03 11:47     ` kyra
2002-08-05  7:46       ` Nicolas Cannasse
2002-08-05  9:32         ` Xavier Leroy
2002-08-05  9:51           ` Nicolas Cannasse
2002-08-06 12:15             ` kyra
2002-08-07  8:55               ` Nicolas Cannasse

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='001101c23a0d$2f184220$0700a8c0@warp' \
    --to=warplayer@free.fr \
    --cc=caml-list@inria.fr \
    --cc=kyrab@mail.ru \
    /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).