From 799d13269a5cdf29a5d68c15ceac42f0407b5833 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 3 Nov 2014 20:05:20 +0200 Subject: MAINT-3585 FIXED Viewer Crashes when attempting to upload image. The bug was fixed, the reasone of crash is following. The Core Flow view contain another GL context and will not care about restoring a previous. I restore context manually. This path also contain a minor changes in another files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All changes described here. Сhange's for fix current bug. indra/llwindow/llwindow.h indra/llwindow/llwindowheadless.h indra/llwindow/llwindowmacosx.h indra/llwindow/llwindowsdl.h indra/llwindow/llwindowwin32.h indra/newview/lllocalbitmaps.cpp indra/newview/llviewerdisplay.cpp indra/newview/llviewerdisplay.h Twice mUsage initialization (replace to forward initialization). indra/llcharacter/lljointstate.h Looks like condition should be befor memcopy call, otherwise - possible CRASH. indra/llcommon/llmd5.cpp Unused condition and variables. indra/llmath/llsphere.cpp Looks like should be under if otherwise - possible CRASH indra\llprimitive\llmodel.cpp Useless assert's. indra/llrender/llrender.cpp indra/newview/lldaycyclemanager.cpp --- indra/llwindow/llwindow.h | 1 + indra/llwindow/llwindowheadless.cpp | 3 +++ indra/llwindow/llwindowheadless.h | 4 +++- indra/llwindow/llwindowmacosx.cpp | 5 +++++ indra/llwindow/llwindowmacosx.h | 2 ++ indra/llwindow/llwindowmesaheadless.h | 1 + indra/llwindow/llwindowsdl.h | 1 + indra/llwindow/llwindowwin32.h | 1 + 8 files changed, 17 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 0a30f4c807..0aa1fbe905 100755 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -122,6 +122,7 @@ public: virtual void gatherInput() = 0; virtual void delayInputProcessing() = 0; virtual void swapBuffers() = 0; + virtual void restoreGLContext() = 0; virtual void bringToFront() = 0; virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract virtual void setOldResize(bool oldresize) { }; diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp index e6e6bc67ff..b6f67c6107 100755 --- a/indra/llwindow/llwindowheadless.cpp +++ b/indra/llwindow/llwindowheadless.cpp @@ -52,3 +52,6 @@ void LLWindowHeadless::swapBuffers() { } +void LLWindowHeadless::restoreGLContext() +{ +} diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 1f767f4c97..5975ee3410 100755 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -74,8 +74,10 @@ public: /*virtual*/ void gatherInput() {}; /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext(); - // handy coordinate space conversion routines + + // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; }; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index e8d0a8bdb8..9ed298a481 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -901,6 +901,11 @@ void LLWindowMacOSX::swapBuffers() CGLFlushDrawable(mContext); } +void LLWindowMacOSX::restoreGLContext() +{ + CGLSetCurrentContext(mContext); +} + F32 LLWindowMacOSX::getGamma() { F32 result = 2.2; // Default to something sane diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 825fd05c5f..194c9bb27a 100755 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -87,6 +87,8 @@ public: /*virtual*/ void gatherInput(); /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext(); + // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 8f70aee4f6..00e42240e6 100755 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -77,6 +77,7 @@ public: /*virtual*/ void gatherInput() {}; /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index c5ce892a04..7193e6f45a 100755 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -97,6 +97,7 @@ public: /*virtual*/ void processMiscNativeEvents(); /*virtual*/ void gatherInput(); /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; /*virtual*/ void delayInputProcessing() { }; diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 169d264808..2ca8d48fc7 100755 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -83,6 +83,7 @@ public: /*virtual*/ void gatherInput(); /*virtual*/ void delayInputProcessing(); /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); -- cgit v1.2.3 From 90573badb4fcea3ae771c466e859854547ed7ad5 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 30 Mar 2015 20:11:27 +0300 Subject: MAINT-3585 FIXED (Crashes when attempting to upload image.) --- indra/llwindow/llwindow.h | 1 - indra/llwindow/llwindowheadless.cpp | 4 ---- indra/llwindow/llwindowheadless.h | 1 - indra/llwindow/llwindowmacosx.cpp | 2 ++ indra/llwindow/llwindowmacosx.h | 8 ++++---- 5 files changed, 6 insertions(+), 10 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 0aa1fbe905..0a30f4c807 100755 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -122,7 +122,6 @@ public: virtual void gatherInput() = 0; virtual void delayInputProcessing() = 0; virtual void swapBuffers() = 0; - virtual void restoreGLContext() = 0; virtual void bringToFront() = 0; virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract virtual void setOldResize(bool oldresize) { }; diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp index b6f67c6107..70f473281b 100755 --- a/indra/llwindow/llwindowheadless.cpp +++ b/indra/llwindow/llwindowheadless.cpp @@ -51,7 +51,3 @@ LLWindowHeadless::~LLWindowHeadless() void LLWindowHeadless::swapBuffers() { } - -void LLWindowHeadless::restoreGLContext() -{ -} diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 5975ee3410..c692666df1 100755 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -74,7 +74,6 @@ public: /*virtual*/ void gatherInput() {}; /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext(); // handy coordinate space conversion routines diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 1f577b117e..fc1ea06d10 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1163,6 +1163,8 @@ void LLWindowMacOSX::beforeDialog() void LLWindowMacOSX::afterDialog() { + //For fix problem with Core Flow view on OSX + restoreGLContext(); } diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 194c9bb27a..9e9bd8ae39 100755 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -87,9 +87,7 @@ public: /*virtual*/ void gatherInput(); /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext(); - - + // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); @@ -157,7 +155,9 @@ protected: //Satisfy MAINT-3135 and MAINT-3288 with a flag. /*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); } - + +private: + void restoreGLContext(); protected: // -- cgit v1.2.3