|
From: James W. W. <ja...@wr...> - 2004-06-23 23:09:29
|
Joseph J. Strout" <jo...@st...> wrote: >Please check my text on reference counting (below)... I want to make >sure I don't lead anyone astray. > >When that reference is about to disappear -- for example, because >it's in a local variable that is about to go out of scope or be >assigned a different value, or in an object that is being destroyed >-- then you must call Q3Object_Dispose to let Quesa know that there >is one less reference to that object. The first use of the word "object" here refers, I assume, to something like a C++ object, while the last use refer to a Quesa object. This may cause confusion. If a reference is held by a Quesa object, such as a group, then it is Quesa's responsibility to dispose the reference when the object is destroyed. >Assuming this is all correct, the reader will be wondering: Why do >Dispose a Q3Object, but I can only GetReference to a Q3SharedObject? >It doesn't seem very parallel. This does not bother me, though maybe I'm just used to it. For shared objects, "dispose" has a special meaning. > And, is it safe to call Q3SharedObject You mean Q3Shared_GetReference? > on something that is not, in fact, a Q3SharedObject If we look at the source code in Quesa, we see that Q3Shared_GetReference will have an assertion failure and then return NULL. >(and what's an example of a Q3Object like that)? Look at the typedefs of TQ3SharedObject etc. in Quesa.h, and you see that views and picks are examples of non-shared Quesa objects. -- James W. Walker, ScriptPerfection Enterprises, Inc. <http://www.write-brain.com/> |