Flush shared memory file before attempting to map
This avoids the error "ValueError: mmap length is greater than file size" on OSX. (see #730)
This commit is contained in:
parent
9aaae8d5dc
commit
839ad486f8
@ -152,6 +152,7 @@ class Renderer(GraphicsView):
|
|||||||
else:
|
else:
|
||||||
self.shmFile = tempfile.NamedTemporaryFile(prefix='pyqtgraph_shmem_')
|
self.shmFile = tempfile.NamedTemporaryFile(prefix='pyqtgraph_shmem_')
|
||||||
self.shmFile.write(b'\x00' * (mmap.PAGESIZE+1))
|
self.shmFile.write(b'\x00' * (mmap.PAGESIZE+1))
|
||||||
|
self.shmFile.flush()
|
||||||
fd = self.shmFile.fileno()
|
fd = self.shmFile.fileno()
|
||||||
self.shm = mmap.mmap(fd, mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_WRITE)
|
self.shm = mmap.mmap(fd, mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_WRITE)
|
||||||
atexit.register(self.close)
|
atexit.register(self.close)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user