Skip to content

Remove the non-MT safe overload of Surface::associateLayer. Do the const_cast on the one client code needing (We have 2 version of that same code) . So as to be obvious where we might have a problem

Remove the non-MT safe overload of Surface::associateLayer.

0276 
0277 inline void
0278 Surface::associateLayer(const Layer& lay)
0279 {
0280   m_associatedLayer = (&lay);
0281 }
0282 
0283 inline void Surface::associateLayer
0284 ATLAS_NOT_CONST_THREAD_SAFE(const Layer& lay) const
0285 {
0286   const_cast<Surface*>(this)->m_associatedLayer = (&lay);
0287 }
0288 

Keep the safe one.

Also clean up some un-needed const that could lead to going through the non-safe method or needed const_cast

Do the actual const_cast on the single client code that actual needs it (We have 2 version of that same code so twice the same code ... but OK ... ).

So as to be obvious where we might have a problem. This is the line that we discuss in ATLASRECTS-6523 and for that matter in ATLASRECTS-6537 and ATLASRECTS-6542

It does not fix something, but "unhides" a bit the actual issue discussed.

Mentioning @sroe

PS : 2 files had spurious ^M removed , so is best to hide whitespace changes when reviewing.

Edited by Christos Anastopoulos

Merge request reports