23.02.2015 13:36, Vlad Khorsun wrote:

>> A solution must be to pass a parameter to destroy methods specifying if
>> they should release or not the object.
>
> Must be ? I don't think so. I'm not ready to point to correct solution
> right now, but additional parameter is not a solution, as for me.
> I prefer to know more opinions...

I'd say that so called "destroy methods" should destroy the state but 
not the object itself, which is the purpose of release(). The 
"destroyed" state must be detectable by all object methods.

IObject* obj = ...
...
obj->something(status); // success
...
obj->destroy(status); // detach / commit / cancel / etc
...
obj->something(status); // returns "bad handle" error
...
obj->release(); // destroys the object (if use_count reaches zero)

And of course this should be followed by all implementations.


Dmitry


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to