mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
Some super-safety in overridden stdout/stderr to ensure we don't
try to write to a deleted qwidget
This commit is contained in:
parent
def4acc14a
commit
fcfe98c8ed
@ -19,6 +19,7 @@ email : lrssvtml (at) gmail (dot) com
|
|||||||
Some portions of code were taken from https://code.google.com/p/pydee/
|
Some portions of code were taken from https://code.google.com/p/pydee/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from qgis.PyQt import sip
|
||||||
from qgis.PyQt.QtCore import Qt, QCoreApplication, QThread, QMetaObject, Q_ARG, QObject, pyqtSlot
|
from qgis.PyQt.QtCore import Qt, QCoreApplication, QThread, QMetaObject, Q_ARG, QObject, pyqtSlot
|
||||||
from qgis.PyQt.QtGui import QColor, QKeySequence
|
from qgis.PyQt.QtGui import QColor, QKeySequence
|
||||||
from qgis.PyQt.QtWidgets import QGridLayout, QSpacerItem, QSizePolicy, QShortcut, QMenu, QApplication
|
from qgis.PyQt.QtWidgets import QGridLayout, QSpacerItem, QSizePolicy, QShortcut, QMenu, QApplication
|
||||||
@ -43,6 +44,8 @@ class writeOut(QObject):
|
|||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def write(self, m):
|
def write(self, m):
|
||||||
|
if sip.isdeleted(self.sO):
|
||||||
|
return
|
||||||
|
|
||||||
# This manage the case when console is called from another thread
|
# This manage the case when console is called from another thread
|
||||||
if QThread.currentThread() != QCoreApplication.instance().thread():
|
if QThread.currentThread() != QCoreApplication.instance().thread():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user