Comment 13 for bug 1847532

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, which dtor do you think the tool shutdown should go into? Right now I put the shutdown call into the child class destructor as the first thing run. I think the reason the tool manager is inside the EDA_BASE_FRAME is because that placement removed duplication of code in the child classes for each window. If we want to, we could shift it into the child classes, we would just have the duplication then. I do think I prefer a shutdown call in the child class destructor though (such as m_toolManager->StopTools()) that makes it obvious we are stopping all tools.

Looking through it some more, we have another option for terminating the tool loop: passing a null event when the tool is reactivated. This will automatically break it out of the while loop that waits for the events, and doesn't require the developer to explicitly check for an event type to end the tool. It requires a bit more implementation work in the tool manager itself, but it is probably cleaner (we could implement it to work on a single tool and on all active tools as well). This will still run any code after the end of the loop though, so the tools should be stopped at as the first step in the destructor.