-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I found, that when you repeatedly instantiate PlotItems and delete them again, the corresponding QMenu objects for the context menus of the plots never get destroyed. I saw lot's of QMenu instances using GammaRay (https://www.kdab.com/development-resources/qt-tools/gammaray/)
But this can simply be reproduced with the following snippet. The more often you create, add and remove new plot instances the more memory is used. Simply increase N to e.g. 100, 500, 1000, 2000 and check the memory usage.
import pyqtgraph as pg
app = pg.mkQApp()
widget = pg.GraphicsLayoutWidget()
widget.show()
N = 10
for i in range(N):
plot = pg.PlotItem()
plot.plot(x=[0,i, N], y=[0.0, 1.0, 0.0])
widget.addItem(plot)
app.processEvents()
widget.removeItem(plot)
if __name__ == '__main__':
pg.exec()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels