From ae95759bcf70e900d822bc8a80f3eda36de2bdf7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 11 Jan 2018 15:17:21 +0200 Subject: MAINT-8170 Crash viewer when double click on "Report Abuse" --- indra/newview/llfloaterreporter.cpp | 13 ++++++++++--- indra/newview/llfloaterreporter.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index c0f5e63623..3a3660bb31 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -162,7 +162,8 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key) mPosition(), mCopyrightWarningSeen( FALSE ), mResourceDatap(new LLResourceData()), - mAvatarNameCacheConnection() + mAvatarNameCacheConnection(), + mSnapshotTimer() { } @@ -245,6 +246,12 @@ LLFloaterReporter::~LLFloaterReporter() void LLFloaterReporter::draw() { LLFloater::draw(); + static LLCachedControl screenshot_delay(gSavedSettings, "AbuseReportScreenshotDelay"); + if (mSnapshotTimer.getStarted() && mSnapshotTimer.getElapsedTimeF32() > screenshot_delay) + { + mSnapshotTimer.stop(); + takeNewSnapshot(); + } } void LLFloaterReporter::enableControls(BOOL enable) @@ -877,8 +884,7 @@ void LLFloaterReporter::onOpen(const LLSD& key) { childSetEnabled("send_btn", false); //Time delay to avoid UI artifacts. MAINT-7067 - doAfterInterval(boost::bind(&LLFloaterReporter::takeNewSnapshot,this), gSavedSettings.getF32("AbuseReportScreenshotDelay")); - + mSnapshotTimer.start(); } void LLFloaterReporter::onLoadScreenshotDialog(const LLSD& notification, const LLSD& response) @@ -950,6 +956,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) void LLFloaterReporter::onClose(bool app_quitting) { + mSnapshotTimer.stop(); gSavedPerAccountSettings.setBOOL("PreviousScreenshotForReport", app_quitting); } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index decc01be98..f5ba63ce7f 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -149,6 +149,7 @@ private: LLPointer mImageRaw; LLPointer mPrevImageRaw; + LLFrameTimer mSnapshotTimer; }; #endif -- cgit v1.2.3