Fix memory leak in GLScatterPlotItem
Fixes #103. If a ScatterPlotItem was removed from a plot and added again, glGenTetures was called again unneccesarily. Each time it is called, it eats up a little more space.
This commit is contained in:
parent
70d9f1eeed
commit
8f273f53ab
@ -66,6 +66,7 @@ class GLScatterPlotItem(GLGraphicsItem):
|
||||
#print pData.shape, pData.min(), pData.max()
|
||||
pData = pData.astype(np.ubyte)
|
||||
|
||||
if getattr(self, "pointTexture", None) is None:
|
||||
self.pointTexture = glGenTextures(1)
|
||||
glActiveTexture(GL_TEXTURE0)
|
||||
glEnable(GL_TEXTURE_2D)
|
||||
|
Loading…
Reference in New Issue
Block a user