std::function::operator bool returns true if it contains a valid target

Change-Id: I8e65c0243094468dca06a1b30b5244bef931f8ac
This commit is contained in:
David Ostrovsky
2015-08-01 08:53:09 +02:00
parent 5916d5866c
commit 935fb7cc07
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ void EventHandler::run()
{
mCallbackQueue.pop( callback );
if ( callback )
if ( !callback )
return;
callback();

View File

@@ -66,7 +66,7 @@ EventManager::EventManager( Player& player, EventHandler& eh )
void EventManager::registerSignal( int signal, const Callback& callback )
{
if ( callback )
if ( !callback )
libvlc_event_detach( mManager, signal, Handler, this );
else
libvlc_event_attach( mManager, signal, Handler, this );