Ignore:
Timestamp:
Oct 13, 2003, 11:18:38 AM (22 years ago)
Author:
sandervl
Message:

Make sure the timer object is not deleted inside the timer callback handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/os2timer.h

    r9901 r10269  
    1 /* $Id: os2timer.h,v 1.12 2003-03-05 14:48:45 sandervl Exp $ */
     1/* $Id: os2timer.h,v 1.13 2003-10-13 09:18:37 sandervl Exp $ */
    22
    33#ifndef __OS2TIMER_H__
     
    4040 ****************************************************************************/
    4141
    42 #if 0
    43 typedef struct _MMTIMEREVENT
    44 {
    45   struct _MMTIMEREVENT* prev;
    46   struct _MMTIMEREVENT* next;
    47 
    48   DWORD           id;                    // event id
    49   DWORD           timeScheduled;         // system time to fire event
    50   DWORD           timePeriod;            // period if periodic event
    51   TID             tidCaller;             // thread ID of caller thread
    52   DWORD           dwUser;                // user supplied value
    53   LPTIMERCALLBACK lpCallback;            // address to call
    54   DWORD           dwFlags;               // event flags
    55 } MMTIMEREVENT, *PMMTIMEREVENT, *LPTIMEREVENT;
    56 #endif
    57 
    5842/*
    5943  addEvent
     
    7559    static BOOL leaveResolutionScope(int dwPeriod); // release resolution request
    7660    static int  queryCurrentResolution();           // query maximum resolution
    77 
     61   
    7862    // public variables
    7963    int dwPeriod;
     
    10791        void          KillTimer();
    10892
    109 
    11093        DWORD         getTimerID()         { return timerID; };
    11194        void          setTimerID(DWORD id) { timerID = id; };
     95
     96#ifdef DEBUG
     97        LONG          addRef();
     98#else
     99        LONG          addRef()         { return InterlockedIncrement(&refCount); };
     100#endif
     101        LONG          getRefCount()    { return refCount; };
     102        LONG          release();
    112103
    113104protected:
     
    130121                Stopped
    131122        };
     123
     124        LONG           refCount;
     125
    132126        static  int    timerPeriod;
    133127
Note: See TracChangeset for help on using the changeset viewer.