constructor option to make the wrapped event autodelete
--HG-- extra : convert_revision : 8663c874c533685adf21eea968b08b40b7d7b665
This commit is contained in:
parent
34d36c45bf
commit
ec6265b044
1 changed files with 7 additions and 2 deletions
|
@ -243,10 +243,13 @@ class EventWrapper : public Event
|
|||
T *object;
|
||||
|
||||
public:
|
||||
EventWrapper(T *obj, EventQueue *q = &mainEventQueue,
|
||||
EventWrapper(T *obj, bool del = false, EventQueue *q = &mainEventQueue,
|
||||
Priority p = Default_Pri)
|
||||
: Event(q, p), object(obj)
|
||||
{}
|
||||
{
|
||||
if (del)
|
||||
setFlags(AutoDelete);
|
||||
}
|
||||
void process() { (object->*F)(); }
|
||||
};
|
||||
|
||||
|
@ -324,6 +327,8 @@ inline void
|
|||
Event::schedule(Tick t)
|
||||
{
|
||||
assert(!scheduled());
|
||||
assert(t >= curTick);
|
||||
|
||||
setFlags(Scheduled);
|
||||
#if TRACING_ON
|
||||
when_scheduled = curTick;
|
||||
|
|
Loading…
Reference in a new issue