Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: kyra <kyrab@m...>
Subject: Re: [Caml-list] OCam'OLE pre-release
From: "Quetzalcoatl Bradley" <qbradley@mail.newheights.com>
>
> 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?)

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