Changeset 784

Show
Ignore:
Timestamp:
12/29/07 03:39:55 (16 years ago)
Author:
ppalmers
Message:

fix shutdown bug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/devicemanager.cpp

    r777 r784  
    8989DeviceManager::~DeviceManager() 
    9090{ 
    91     delete m_processorManager; 
    92  
    9391    for ( FFADODeviceVectorIterator it = m_avDevices.begin(); 
    9492          it != m_avDevices.end(); 
     
    10098        delete *it; 
    10199    } 
     100 
     101    // the SP's are automatically unregistered at the SPM 
     102    delete m_processorManager; 
    102103 
    103104    for ( FunctorVectorIterator it = m_busreset_functors.begin(); 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r750 r784  
    5757                 getConfigRom().getNodeId() ); 
    5858    addOption(Util::OptionContainer::Option("snoopMode",false)); 
     59} 
     60 
     61AvDevice::~AvDevice() 
     62{ 
     63    for ( StreamProcessorVectorIterator it = m_receiveProcessors.begin(); 
     64          it != m_receiveProcessors.end(); 
     65          ++it ) 
     66    { 
     67        delete *it; 
     68    } 
     69    for ( StreamProcessorVectorIterator it = m_transmitProcessors.begin(); 
     70          it != m_transmitProcessors.end(); 
     71          ++it ) 
     72    { 
     73        delete *it; 
     74    } 
    5975} 
    6076 
  • trunk/libffado/src/genericavc/avc_avdevice.h

    r750 r784  
    4949public: 
    5050    AvDevice( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom )); 
    51     virtual ~AvDevice() {}
    52  
     51    virtual ~AvDevice()
     52     
    5353    static bool probe( ConfigRom& configRom ); 
    5454    virtual bool discover(); 
     
    9595    // streaming stuff 
    9696    typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector; 
     97    typedef std::vector< Streaming::StreamProcessor * >::iterator StreamProcessorVectorIterator; 
    9798    StreamProcessorVector m_receiveProcessors; 
    9899    StreamProcessorVector m_transmitProcessors; 
  • trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

    r782 r784  
    5656{ 
    5757    stopHandlers(); 
     58    pruneHandlers(); 
     59    if(m_IsoHandlers.size() > 0) { 
     60        debugError("Still some handlers in use\n"); 
     61    } 
    5862    if (m_Thread) { 
    5963        m_Thread->Stop(); 
  • trunk/libffado/src/libstreaming/StreamProcessorManager.cpp

    r783 r784  
    120120        { 
    121121            if ( *it == processor ) { 
     122                if (*it == m_SyncSource) { 
     123                    debugOutput(DEBUG_LEVEL_VERBOSE, "unregistering sync source"); 
     124                    m_SyncSource = NULL; 
     125                } 
    122126                m_ReceiveProcessors.erase(it); 
    123127                return true; 
     
    132136        { 
    133137            if ( *it == processor ) { 
     138                if (*it == m_SyncSource) { 
     139                    debugOutput(DEBUG_LEVEL_VERBOSE, "unregistering sync source"); 
     140                    m_SyncSource = NULL; 
     141                } 
    134142                m_TransmitProcessors.erase(it); 
    135143                return true; 
     
    289297 
    290298bool StreamProcessorManager::syncStartAll() { 
     299    if(m_SyncSource == NULL) return false; 
    291300    // figure out when to get the SP's running. 
    292301    // the xmit SP's should also know the base timestamp 
     
    434443StreamProcessorManager::alignReceivedStreams() 
    435444{ 
     445    if(m_SyncSource == NULL) return false; 
    436446    #define ALIGN_AVERAGE_TIME_MSEC 200 
    437447    #define NB_ALIGN_TRIES 40 
     
    659669 */ 
    660670bool StreamProcessorManager::waitForPeriod() { 
     671    if(m_SyncSource == NULL) return false; 
    661672    int time_till_next_period; 
    662673    bool xrun_occurred = false; 
    663674 
    664675    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "enter...\n"); 
    665  
    666     assert(m_SyncSource); 
    667676 
    668677    time_till_next_period=m_SyncSource->getTimeUntilNextPeriodSignalUsecs(); 
     
    839848 */ 
    840849bool StreamProcessorManager::transfer(enum StreamProcessor::eProcessorType t) { 
     850    if(m_SyncSource == NULL) return false; 
    841851    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "transfer(%d) at TS=%011llu (%03us %04uc %04ut)...\n",  
    842852        t, m_time_of_transfer, 
     
    909919 */ 
    910920bool StreamProcessorManager::transferSilence(enum StreamProcessor::eProcessorType t) { 
     921    if(m_SyncSource == NULL) return false; 
    911922    debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "transferSilence(%d) at TS=%011llu (%03us %04uc %04ut)...\n",  
    912923        t, m_time_of_transfer,