11.08.10, 20:37, "Noel O'Boyle" <baoille...@gmail.com>:

> Hi all,
>  
>  I am trying to track down a segfault on a SMI to CML conversion which
>  fails in the destructor of ~OBConversion at "delete pLineEndBuf".
>  
>  I am wondering whether this is related to the following in the copy
>  constructor OBConversion::OBConversion(const OBConversion& o):
>  
>  pLineEndBuf    = o.pLineEndBuf;
>  
>  "p" indicates a pointer and I think that (in this case) it's either
>  NULL or else pointing to an object allocated with "new". 

It's not a good thing that two objects own one data pointer if it's not clear 
which of them should free memory.
Maybe you need to use

*pLineEndBuf    = *o.pLineEndBuf;

(copy instead of share)?

-- 
Regards,
Konstantin

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to