diff --git a/examples/SharedMemory/b3PluginManager.cpp b/examples/SharedMemory/b3PluginManager.cpp index fa06cd52b..7703abb54 100644 --- a/examples/SharedMemory/b3PluginManager.cpp +++ b/examples/SharedMemory/b3PluginManager.cpp @@ -112,7 +112,7 @@ struct b3PluginManagerInternalData b3BulletDefaultFileIO m_defaultFileIO; b3PluginManagerInternalData() - : m_rpcCommandProcessorInterface(0), m_activeNotificationsBufferIndex(0), m_activeRendererPluginUid(-1), m_activeCollisionPluginUid(-1), m_numNotificationPlugins(0), m_activeFileIOPluginUid(-1) + : m_physicsDirect(0), m_rpcCommandProcessorInterface(0), m_activeNotificationsBufferIndex(0), m_activeRendererPluginUid(-1), m_activeCollisionPluginUid(-1), m_numNotificationPlugins(0), m_activeFileIOPluginUid(-1) { } }; diff --git a/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp b/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp index 43d20387a..0be09d9db 100644 --- a/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp +++ b/examples/SharedMemory/plugins/fileIOPlugin/fileIOPlugin.cpp @@ -388,35 +388,37 @@ struct WrapperFileIO : public CommonFileIOInterface int childHandle = childFileIO->fileOpen(fileName, mode); if (childHandle>=0) { - int fileSize = childFileIO->getFileSize(childHandle); - char* buffer = 0; - if (fileSize) - { - buffer = m_cachedFiles.allocateBuffer(fileSize); - if (buffer) - { - int readBytes = childFileIO->fileRead(childHandle, buffer, fileSize); - if (readBytes!=fileSize) - { - if (readBytesgetFileSize(childHandle); + char* buffer = 0; + if (fileSize) + { + buffer = m_cachedFiles.allocateBuffer(fileSize); + if (buffer) + { + int readBytes = childFileIO->fileRead(childHandle, buffer, fileSize); + if (readBytes!=fileSize) + { + if (readBytesfileClose(childHandle); break; }