← Back to team overview

kicad-developers team mailing list archive

Ownership semantics for EDA_DRAW_FRAME::m_currentScreen

 

Hi,

I'm trying to figure out who is owning the *_SCREEN object pointed to by
EDA_DRAW_FRAME::m_currentScreen.

In EDA_DRAW_FRAME::~EDA_DRAW_FRAME(), the object pointed to is deleted,
which suggests to me that the draw frame has some sort of ownership,
however this will only delete the last object attached -- if SetScreen()
is called, the old object is not deleted.

What is the intended semantic here? Should the DRAW_FRAME take
ownership, or not? As it is now, anyone calling SetScreen() must
remember to GetScreen() first, so they can clean up if needed, which is
somewhat counterintuitive for an interface.

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups