summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-12-03 17:01:53 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2012-12-03 17:01:53 -0800
commitad7cb33bbc4f3dae5ad8396b11e98d2e1490e349 (patch)
treeb3eca812c6f582332a107ccb28c1b4a94df8d3cf /indra/llui
parent2ee6bcab371a08791bccad3a4fa072c1d60cd6c9 (diff)
parent1ce49f764fa00406088f7bcd7623603baedd5fe8 (diff)
merging in latest changes
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp2
-rw-r--r--indra/llui/llflashtimer.cpp9
-rw-r--r--indra/llui/llflashtimer.h6
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 */