Changeset 9671 for trunk/src


Ignore:
Timestamp:
Jan 14, 2003, 8:38:38 PM (23 years ago)
Author:
sandervl
Message:

Delete all wave object on unload; fix linked list synchronization

Location:
trunk/src/winmm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/dbgwrap.cpp

    r9296 r9671  
    156156DEBUGWRAP8(timeGetDevCaps)
    157157DEBUGWRAP8(timeGetSystemTime)
    158 DEBUGWRAP0(timeGetTime)
     158DEBUGWRAP_LVL2_0(timeGetTime)
    159159DEBUGWRAP4(timeKillEvent)
    160160DEBUGWRAP20(timeSetEvent)
  • trunk/src/winmm/initwinmm.cpp

    r8857 r9671  
    1 /* $Id: initwinmm.cpp,v 1.10 2002-07-12 08:59:24 sandervl Exp $
     1/* $Id: initwinmm.cpp,v 1.11 2003-01-14 19:38:37 sandervl Exp $
    22 *
    33 * WINMM DLL entry point
     
    183183
    184184   case DLL_PROCESS_DETACH:
     185        WaveInOut::shutdown();
    185186        MULTIMEDIA_DeleteIData();
    186187        auxOS2Close();    /* Close aux device if necessary */
  • trunk/src/winmm/waveinoutbase.cpp

    r8202 r9671  
    1 /* $Id: waveinoutbase.cpp,v 1.4 2002-04-07 14:36:31 sandervl Exp $ */
     1/* $Id: waveinoutbase.cpp,v 1.5 2003-01-14 19:38:38 sandervl Exp $ */
    22
    33/*
     
    3535#include "dbglocal.h"
    3636
     37VMutex wavemutex;
    3738
    3839/******************************************************************************/
     
    5556    State    = STATE_STOPPED;
    5657
    57     wmutex.enter();
     58    wavemutex.enter();
    5859
    59     if(wave == NULL) {
    60         wave = this;
     60    if(head == NULL) {
     61        head = this;
    6162    }
    6263    else {
    63         WaveInOut *dwave = wave;
     64        WaveInOut *dwave = head;
    6465
    6566        while(dwave->next) {
     
    6869        dwave->next = this;
    6970    }
    70     wmutex.leave();
     71    wavemutex.leave();
    7172
    7273    this->fdwOpen = fdwOpen;
     
    7879WaveInOut::~WaveInOut()
    7980{
    80     wmutex.enter();
     81    wavemutex.enter();
    8182
    8283    State = STATE_STOPPED;
    8384
    84     if(wave == this) {
    85         wave = this->next;
     85    if(head == this) {
     86        head = this->next;
    8687    }
    8788    else {
    88         WaveInOut *dwave = wave;
     89        WaveInOut *dwave = head;
    8990
    9091        while(dwave->next != this) {
     
    9394        dwave->next = this->next;
    9495    }
    95     wmutex.leave();
     96    wavemutex.leave();
    9697}
    9798/******************************************************************************/
     
    146147}
    147148/******************************************************************************/
     149//Delete all active wave objects
     150/******************************************************************************/
     151void WaveInOut::shutdown()
     152{
     153    dprintf(("WaveInOut::shutdown"));
     154    wavemutex.enter();
     155    while(head) {
     156        delete head;
     157    }
     158    wavemutex.leave();
     159    dprintf(("WaveInOut::shutdown end"));
     160}
     161/******************************************************************************/
    148162/******************************************************************************/
    149163BOOL WaveInOut::find(WaveInOut *dwave)
    150164{
    151  WaveInOut *curwave = wave;
     165    wavemutex.enter();
     166
     167    WaveInOut *curwave = head;
    152168
    153169    while(curwave) {
    154170        if(dwave == curwave) {
     171            wavemutex.leave();
    155172            return(TRUE);
    156173        }
    157174        curwave = curwave->next;
    158175    }
     176    wavemutex.leave();
    159177
    160178    dprintf2(("WINMM:WaveInOut not found!\n"));
     
    163181/******************************************************************************/
    164182/******************************************************************************/
    165 WaveInOut *WaveInOut::wave = NULL;
     183WaveInOut *WaveInOut::head = NULL;
    166184
  • trunk/src/winmm/waveinoutbase.h

    r8572 r9671  
    1 /* $Id: waveinoutbase.h,v 1.2 2002-06-05 11:05:56 sandervl Exp $ */
     1/* $Id: waveinoutbase.h,v 1.3 2003-01-14 19:38:38 sandervl Exp $ */
    22
    33/*
     
    3636
    3737  static BOOL find(WaveInOut *wave);
     38  static void shutdown();
    3839
    3940protected:
     
    5758               *curhdr;
    5859
    59     VMutex      wmutex;
     60         VMutex wmutex;
     61
     62private:
    6063                                          // Linked list management
    6164                WaveInOut *next;          // Next wave class
    62     static      WaveInOut *wave;          // List of wave classes
    63 
    64 private:
    65 
     65    static      WaveInOut *head;          // List of wave classes
    6666};
    6767
Note: See TracChangeset for help on using the changeset viewer.