[geos-devel] ownership transfer && exceptions

strk strk at keybit.net
Wed Jul 14 05:50:58 EDT 2004

All geometry contructors currently take
ownership of one or more arguments.
In case of an exception, do you think they should
delete these arguments ? In other words, should
ownership transfer happen at call time or at
successfull completion time ?

Call time transfer would forbid further handling
of passed arguments by the caller in case of
a failure. For example a caller might
want to print a descriptive report of passed *offending*
arguments which would have been destroied in that case.

On the other hand, successfull competion time has
the drawback that every geometry construction should
be wrapped by a try/catch block to avoid memory leaks.

What do you think ?


More information about the geos-devel mailing list