HomeWildfire Games

Fix unreported glooxwrapper leaks following rP19703, refs #2305.

Description

Fix unreported glooxwrapper leaks following rP19703, refs #2305.

Fixes an occurring leak indicated by the reported clang unused variable compiler warning, refs #5294, #5550,
by adding the missing glooxwrapper::Jingle::Session::Session destructor .

Fix two leaks that would have occurred if the according code had been used:
Delete unused glooxwrapper::Jingle::ICEUDP::ICEUDP instead of adding the missing destructor.
Delete unused glooxwrapper::Jingle::Content::Content instead of adding the missing destructor.

Explain why glooxwrapper::Client::registerStanzaExtension doesn't leak the new StanzaExtensionWrapper.
Explain why glooxwrapper::Jingle::Session::sessionInitiate doesn't leak the new gloox::Jingle::Content, nor the new gloox::Jingle::ICEUDP.
Explain why glooxwrapper::SessionManager::registerPlugins doesn't leak the new gloox::Jingle::Content and new gloox::Jingle::ICEUDP.
Explain why glooxwrapper::SessionManager::createSession doesn't leak the gloox::Jingle::Session.

I will not leak memory in the glooxwrapper.
I will not leak memory in the glooxwrapper.
I will not leak memory in the glooxwrapper.

Use references in the StunClient and glooxwrapper to anticipate any confusion as to whose obligation it is to delete variables when they are passed around across several files.
Use static_cast and reinterpret_cast instead of C-style casts in the StunClient.

Differential Revision: https://code.wildfiregames.com/D2094
Refs D2093 for the reported leaks.
Reviewed By: Josh
Comments By: fcxSanya, Vladislav for D2094, and echotangoecho, leper in rP19703