PingPong example: let the parent QObject do the cleanup
The m_timer and m_serverInfo instances are created using 'this' as a parent, so we do not need to explicitly delete them in the destructor, but let the parent object deal with them. This also prevents a crash at application close. Pick-to: 6.3 6.2 5.15 Change-Id: If91f01e1ab6dc8e839a06773464eeb9858d2fd36 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
parent
4bd126afae
commit
4d2df2461f
|
@ -60,8 +60,7 @@ PingPong::PingPong()
|
|||
|
||||
PingPong::~PingPong()
|
||||
{
|
||||
delete m_timer;
|
||||
delete m_serverInfo;
|
||||
m_timer->stop();
|
||||
delete socket;
|
||||
delete discoveryAgent;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue