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
[Caml-list] OCam'OLE pre-release
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-04 (10:58)
From: kyra <kyrab@m...>
Subject: Re: [Caml-list] OCam'OLE pre-release
From: "Quetzalcoatl Bradley" <>
> It is not safe to use any COM object, including calling Release on it,
> calling CoUninitialize.  Also in my experience there is much danger in
> relying on the order of constructor and destructor call of static
> 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
> 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"
> collection?)

Errors mentioned have HOTHING with improper CoUnitialize call. I' have
already written they persist even if I _remove_ CoUnitialize totally. Errors
are because of COM interface is called _after_ being entirely Released.
Moreover, not only native olegen but also native excel1 works just fine with
my modifications. My static object destructor call of CoUninitialize does
not check 'uninit' flag and so 'do_not_close()' has no impact on
CoUninitialize call, but I see no any freezings or something like this.

I am too bad com or ocaml expert, but i'd prefer to unbind Release from
com_finalize, and to have an option to call Release explicitly.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: