caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Quetzalcoatl Bradley" <qbradley@mail.newheights.com>
To: <caml-list@inria.fr>
Subject: RE: [Caml-list] OCam'OLE pre-release
Date: Fri, 2 Aug 2002 16:23:10 -0700	[thread overview]
Message-ID: <HDEEJKDKJOFDHDMBDAGHMEHOCFAA.qbradley@newheights.com> (raw)
In-Reply-To: <000e01c23a7c$03b4ee20$551aa8c0@kyra>


It is not safe to use any COM object, including calling Release on it, after
calling CoUninitialize.  Also in my experience there is much danger in
relying on the order of constructor and destructor call of static variables
to manage lifetime of COM objects or CoInitialize/CoUnitialize call.

Move your CoUnitialize call out of a static variable and into the last
statement of your program.  Since the GC will not run after your
CoUnitialize call, no Release calls will be made on any COM object after
CoUnitialize.  Alternatively, do whatever is necessary to make sure that all
your COM objects are released before your program exits (perhaps by making
sure there is no reachable COM object and then doing a "full major" garbage
collection?)

Quetzalcoatl Bradley
qbradley@blackfen.com


-----Original Message-----
From: owner-caml-list@pauillac.inria.fr
[mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of kyra
Sent: Friday, August 02, 2002 4:26 PM
To: Nicolas Cannasse; OCaml
Subject: Re: [Caml-list] OCam'OLE pre-release


> 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 ).

But ocaml variable and COM reference are merely different things.

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

This does not work. Even not to call CoUninitialize does not work. There is
the same access violation (not segfault as i've early mentioned) error
everywhere: "The object invoked has disconnected from its clients". I am in
no way ocaml or COM expert, but it seems this is because ocaml not only GCs
_unneeded variable_ but also Releases _still needed_ interface.

-------------------
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
-------------------
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-03 21:32 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
2002-08-02 23:26     ` kyra
2002-08-02 23:23       ` Quetzalcoatl Bradley [this message]
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=HDEEJKDKJOFDHDMBDAGHMEHOCFAA.qbradley@newheights.com \
    --to=qbradley@mail.newheights.com \
    --cc=caml-list@inria.fr \
    /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).