fdo#88006, Valgrind and ImplSVData (vcl part)

Stephan Bergmann sbergman at redhat.com
Mon Jan 5 01:37:39 PST 2015


On 01/04/2015 09:55 AM, julien2412 wrote:
> I noticed this (after having added "--track-origins=yes" to Valgrind line

btw, you can also pass that in via VALGRIND_OPTS env var,

   VALGRIND=memcheck VALGRIND_OPTS=--track-origins=yes soffice

> Here's the content of ImplGetSVData():
>       79 ImplSVData::ImplSVData()
>       80 {
>       81     // init global instance data
>       82     memset( this, 0, sizeof( ImplSVData ) );
>       83     maHelpData.mbAutoHelpId = true;
>       84     maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT
> );
>       85 }
>
> I know it's been like this since 2007 at least but is it really ok to
> initialize an object (which contains not only integral types but also
> structure/classes) this way?

In principle, no; in practice, yes.  (Incidentally, I recently made a 
mental node to eventually clean that up while doing 
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=55b68ad017d61f2fd4a3408632007880aabd05fe> 
"Instantiate ImplSVData on demand," but didn't yet come around to it. 
Feel free to clean up.)



More information about the LibreOffice mailing list