Merge pull request #758 from campagnola/fix-osx-remote

Flush shared memory file before attempting to map
This commit is contained in:
Luke Campagnola 2018-09-11 08:54:15 -07:00 committed by GitHub
commit a690ea41a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,6 +152,7 @@ class Renderer(GraphicsView):
else:
self.shmFile = tempfile.NamedTemporaryFile(prefix='pyqtgraph_shmem_')
self.shmFile.write(b'\x00' * (mmap.PAGESIZE+1))
self.shmFile.flush()
fd = self.shmFile.fileno()
self.shm = mmap.mmap(fd, mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_WRITE)
atexit.register(self.close)