Commit e95b99e6 authored by Erwan Tulou's avatar Erwan Tulou

skins2: work around a deallocation problem

VlcManager and VarManager dependents on each other (a design problem)
Anyway, it is a bad idea to use instance() on any manager when deallocating ressources
as it can start anew a manager already deallocated.
Better use global variables in p_sys and act accordingly.
parent f7459276
......@@ -219,14 +219,21 @@ void VarText::onUpdate( Subject<VarText> &rVariable, void *arg )
void VarText::delObservers()
{
// Stop observing other variables
VlcProc *pVlcProc = VlcProc::instance( getIntf() );
pVlcProc->getTimeVar().delObserver( this );
pVlcProc->getVolumeVar().delObserver( this );
pVlcProc->getStreamNameVar().delObserver( this );
pVlcProc->getStreamURIVar().delObserver( this );
pVlcProc->getStreamBitRateVar().delObserver( this );
pVlcProc->getStreamSampleRateVar().delObserver( this );
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getHelpText().delObserver( this );
VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
VarManager *pVarManager = getIntf()->p_sys->p_varManager;
if( pVlcProc )
{
pVlcProc->getTimeVar().delObserver( this );
pVlcProc->getVolumeVar().delObserver( this );
pVlcProc->getStreamNameVar().delObserver( this );
pVlcProc->getStreamURIVar().delObserver( this );
pVlcProc->getStreamBitRateVar().delObserver( this );
pVlcProc->getStreamSampleRateVar().delObserver( this );
}
if( pVarManager )
pVarManager->getHelpText().delObserver( this );
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment