Added clean-up
Clean-up statics at the end of main to avoid added noise when looking for leaks
This commit is contained in:
parent
333e6e6254
commit
dd5b9c2ae5
4 changed files with 58 additions and 8 deletions
|
@ -32,8 +32,27 @@ namespace Catch
|
|||
Hub& Hub::me
|
||||
()
|
||||
{
|
||||
static Hub hub;
|
||||
Hub*& hub = singleInstance();
|
||||
if( !hub )
|
||||
hub = new Hub();
|
||||
return *hub;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
void Hub::cleanUp
|
||||
()
|
||||
{
|
||||
Hub*& hub = singleInstance();
|
||||
delete hub;
|
||||
hub = NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
Hub*& Hub::singleInstance()
|
||||
{
|
||||
static Hub* hub = NULL;
|
||||
return hub;
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue