fix crash on launch with shrinked imageviewer
This commit is contained in:
parent
2b95cf72d0
commit
c6848d2175
3 changed files with 12 additions and 0 deletions
|
@ -1345,6 +1345,8 @@ void ImageViewer::onContextAboutToBeDestroyed() {
|
|||
makeCurrent();
|
||||
m_lutCalibrator->cleanup();
|
||||
doneCurrent();
|
||||
disconnect(context(), SIGNAL(aboutToBeDestroyed()), this,
|
||||
SLOT(onContextAboutToBeDestroyed()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1352,6 +1354,9 @@ void ImageViewer::onContextAboutToBeDestroyed() {
|
|||
void ImageViewer::onPreferenceChanged(const QString& prefName) {
|
||||
if (prefName == "ColorCalibration") {
|
||||
if (Preferences::instance()->isColorCalibrationEnabled()) {
|
||||
// if the window is so shriked that the gl widget is empty,
|
||||
// showEvent can be called before creating the context.
|
||||
if (!context()) return;
|
||||
makeCurrent();
|
||||
if (!m_lutCalibrator)
|
||||
m_lutCalibrator = new LutCalibrator();
|
||||
|
|
|
@ -1209,6 +1209,9 @@ void SceneViewer::onStopMotionLiveViewStopped() {
|
|||
void SceneViewer::onPreferenceChanged(const QString &prefName) {
|
||||
if (prefName == "ColorCalibration") {
|
||||
if (Preferences::instance()->isColorCalibrationEnabled()) {
|
||||
// if the window is so shriked that the gl widget is empty,
|
||||
// showEvent can be called before creating the context.
|
||||
if (!context()) return;
|
||||
makeCurrent();
|
||||
if (!m_lutCalibrator)
|
||||
m_lutCalibrator = new LutCalibrator();
|
||||
|
@ -3555,6 +3558,8 @@ void SceneViewer::onContextAboutToBeDestroyed() {
|
|||
makeCurrent();
|
||||
m_lutCalibrator->cleanup();
|
||||
doneCurrent();
|
||||
disconnect(context(), SIGNAL(aboutToBeDestroyed()), this,
|
||||
SLOT(onContextAboutToBeDestroyed()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -989,6 +989,8 @@ void HexagonalColorWheel::onContextAboutToBeDestroyed() {
|
|||
makeCurrent();
|
||||
m_lutCalibrator->cleanup();
|
||||
doneCurrent();
|
||||
disconnect(context(), SIGNAL(aboutToBeDestroyed()), this,
|
||||
SLOT(onContextAboutToBeDestroyed()));
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue