Skip to content

Commit 8117d33

Browse files
committed
Fixed random crashes (segfaults) on Linux related to Qt objects stored in cache data
1 parent 9605407 commit 8117d33

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# PythonQwt Releases
22

3+
## Version 0.12.6
4+
5+
- Fixed random crashes (segfaults) on Linux related to Qt objects stored in cache data
6+
structures (`QwtText` and `QwtSymbol`)
7+
8+
- Test suite can simply be run with `pytest` and specific configuration (`conftest.py`)
9+
will be taken into account (previously, the test suite has to be run with
10+
`pytest qwt` in order to be successfully configured)
11+
312
## Version 0.12.5
413

514
- Add support for NumPy 2.0:

qwt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
from qwt.text import QwtText # noqa: F401
5656
from qwt.toqimage import array_to_qimage as toQImage # noqa: F401
5757

58-
__version__ = "0.12.5"
58+
__version__ = "0.12.6"
5959
QWT_VERSION_STR = "6.1.5"
6060

6161

qwt/symbol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def __init__(self, st, br, pn, sz):
341341
self.brush = br
342342
self.pen = pn
343343
self.isPinPointEnabled = False
344-
self.pinPoint = QPointF()
344+
self.pinPoint = None
345345

346346
class Path(object):
347347
def __init__(self):
@@ -1235,7 +1235,7 @@ def invalidateCache(self):
12351235
:py:meth:`setCachePolicy()`, :py:meth:`drawSymbols()`
12361236
"""
12371237
if self.__data.cache.pixmap is not None:
1238-
self.__data.cache.pixmap = QPixmap()
1238+
self.__data.cache.pixmap = None
12391239

12401240
def setStyle(self, style):
12411241
"""

qwt/text.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,11 @@ def __init__(self):
474474

475475
class QwtText_LayoutCache(object):
476476
def __init__(self):
477-
self.textSize = QSizeF()
477+
self.textSize = None
478478
self.font = None
479479

480480
def invalidate(self):
481-
self.textSize = QSizeF()
481+
self.textSize = None
482482

483483

484484
class QwtText(object):
@@ -987,7 +987,8 @@ def textSize(self, defaultFont):
987987
"""
988988
font = QFont(self.usedFont(defaultFont))
989989
if (
990-
not self.__layoutCache.textSize.isValid()
990+
self.__layoutCache.textSize is None
991+
or not self.__layoutCache.textSize.isValid()
991992
or self.__layoutCache.font is not font
992993
):
993994
self.__layoutCache.textSize = self.__data.textEngine.textSize(

0 commit comments

Comments
 (0)