POV-Ray : Newsgroups : povray.programming : code cleanup : Re: code cleanup Server Time
6 Oct 2024 02:32:28 EDT (-0400)
  Re: code cleanup  
From: Thorsten Froehlich
Date: 15 Aug 2017 16:50:01
Message: <web.59935e21e42ebdf653e6c55b0@news.povray.org>
"hexcoder" <nomail@nomail> wrote:
>
> [source/base/povmscpp.cpp:1757]: (error) Memory leak: nodeptr
>
> In case of an exception nodeptr cannot be freed anymore...
>
> [source/base/povmscpp.cpp:1781]: (error) Memory leak: nodeptr
>
> In case of an exception nodeptr cannot be freed anymore...
>
> In both cases could
>
>  err = POVMS_InstallReceiver(context, ReceiveHandler, hclass, hid, (void
> *)this);
>  if(err != pov_base::kNoErr)
>   throw POV_EXCEPTION_CODE(err);
>
> be moved to the beginning of the method? I see no dependency to local variables
> here.

No. This exception will always have to be a fatal error for the application
because if is more or less an emergency exit when POV-Ray runs out of memory. So
it is too late the fiddle with memory anyway. Basically all POVMS errors are
fatal because it means communication within POV-Ray's threads is broken, in
which case you actually "leak" whole threads...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.