diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llbutton.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llflashtimer.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llflashtimer.h | 6 |
3 files changed, 15 insertions, 2 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 97547208ec..f82cdc64a9 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -286,7 +286,7 @@ LLButton::~LLButton() if (mFlashingTimer) { - delete mFlashingTimer; + mFlashingTimer->unset(); } } diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index de7a4ab265..e49628acd5 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -35,6 +35,7 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) , mCurrentTickCount(0) , mIsFlashingInProgress(false) , mIsCurrentlyHighlighted(false) + , mUnset(false) { mEventTimer.stop(); @@ -48,6 +49,12 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) } } +void LLFlashTimer::unset() +{ + mUnset = true; + mCallback = NULL; +} + BOOL LLFlashTimer::tick() { mIsCurrentlyHighlighted = !mIsCurrentlyHighlighted; @@ -62,7 +69,7 @@ BOOL LLFlashTimer::tick() stopFlashing(); } - return FALSE; + return mUnset; } void LLFlashTimer::startFlashing() diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 5c8860b097..c60f99a8ea 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -52,6 +52,11 @@ public: bool isFlashingInProgress(); bool isCurrentlyHighlighted(); + /* + * Use this instead of deleting this object. + * The next call to tick() will return true and that will destroy this object. + */ + void unset(); private: callback_t mCallback; @@ -62,6 +67,7 @@ private: S32 mCurrentTickCount; bool mIsCurrentlyHighlighted; bool mIsFlashingInProgress; + bool mUnset; }; #endif /* LL_FLASHTIMER_H */ |