From ad10da57c5f6340a8512233593b83f8aa00d683c Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Thu, 11 Oct 2018 17:00:17 -0700 Subject: [PATCH] more initial work on fileIOPlugin --- .../SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp b/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp index d592ce48e..84e522cf0 100644 --- a/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp +++ b/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp @@ -88,15 +88,16 @@ struct WrapperFileIO : public CommonFileIOInterface { //find an available wrapperFileHandle slot int wrapperFileHandle=-1; + int slot = -1; for (int i=0;i=0) + if (slot>=0) { //figure out what wrapper interface to use //use the first one that can open the file @@ -108,8 +109,9 @@ struct WrapperFileIO : public CommonFileIOInterface int childHandle = childFileIO->fileOpen(fileName, mode); if (childHandle>=0) { - m_wrapperFileHandles[wrapperFileHandle].childFileIO = childFileIO; - m_wrapperFileHandles[wrapperFileHandle].m_childFileHandle = childHandle; + wrapperFileHandle = slot; + m_wrapperFileHandles[slot].childFileIO = childFileIO; + m_wrapperFileHandles[slot].m_childFileHandle = childHandle; break; } }