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 ) ...@@ -219,14 +219,21 @@ void VarText::onUpdate( Subject<VarText> &rVariable, void *arg )
void VarText::delObservers() void VarText::delObservers()
{ {
// Stop observing other variables // Stop observing other variables
VlcProc *pVlcProc = VlcProc::instance( getIntf() );
VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
VarManager *pVarManager = getIntf()->p_sys->p_varManager;
if( pVlcProc )
{
pVlcProc->getTimeVar().delObserver( this ); pVlcProc->getTimeVar().delObserver( this );
pVlcProc->getVolumeVar().delObserver( this ); pVlcProc->getVolumeVar().delObserver( this );
pVlcProc->getStreamNameVar().delObserver( this ); pVlcProc->getStreamNameVar().delObserver( this );
pVlcProc->getStreamURIVar().delObserver( this ); pVlcProc->getStreamURIVar().delObserver( this );
pVlcProc->getStreamBitRateVar().delObserver( this ); pVlcProc->getStreamBitRateVar().delObserver( this );
pVlcProc->getStreamSampleRateVar().delObserver( this ); pVlcProc->getStreamSampleRateVar().delObserver( this );
VarManager *pVarManager = VarManager::instance( getIntf() ); }
if( pVarManager )
pVarManager->getHelpText().delObserver( this ); 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