Permalink
Browse files

some fixes for the physics and sound plugin to not segfault on exit

  • Loading branch information...
1 parent aa8662a commit a8d53daffab1a14ec06ee1fee72ad0890ff0df90 @shua committed Mar 24, 2012
View
@@ -263,19 +263,21 @@ Ogre::String FysicsEditorFactory::GetPlaceHolderName()
return "Fysics.mesh";
}
/////////////////////////////////////////////////////////////////////////
-FysicsEditorFactory *fysicsFac = 0;
bool dllStartPlugin(void *identifier, Ogre::String& name)
{
name = "Fysics Object";
- fysicsFac = OGRE_NEW FysicsEditorFactory();
- OgitorsRoot::getSingletonPtr()->RegisterEditorFactory(identifier, fysicsFac);
+ OgitorsRoot::getSingletonPtr()->RegisterEditorFactory(identifier, OGRE_NEW FysicsEditorFactory());
+ return true;
+}
+
+bool dllGetPluginName(Ogre::String& name)
+{
+ name = "Fysics Object";
return true;
}
bool dllStopPlugin(void)
{
- OGRE_DELETE fysicsFac;
- fysicsFac = 0;
return true;
}
View
@@ -82,4 +82,6 @@ class PluginExport FysicsEditorFactory: public CBaseEditorFactory
extern "C" bool PluginExport dllStartPlugin(void *identifier, Ogre::String& name);
+extern "C" bool PluginExport dllGetPluginName(Ogre::String& name);
+
extern "C" bool PluginExport dllStopPlugin(void);
@@ -2,7 +2,6 @@
#include "Ogitors.h"
#include "FaPlayer.h"
-using namespace Ogitors;
using namespace Ogre;
PlayerControllerEditor::PlayerControllerEditor(CBaseEditorFactory *factory) : CBaseEditor(factory) {
@@ -78,4 +77,4 @@ bool dllGetPluginName(Ogre::String& name) {
bool dllStopPlugin(void) {
return true;
-}
+}
@@ -17,4 +17,4 @@ add_library(SoundPlugin SHARED ${HEADER_FILES} ${SOURCE_FILES})
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_DIR})
set_target_properties(SoundPlugin PROPERTIES COMPILE_DEFINITIONS PLUGIN_EXPORT)
-set_target_properties(SoundPlugin PROPERTIES SOLUTION_FOLDER Plugins)
+set_target_properties(SoundPlugin PROPERTIES SOLUTION_FOLDER Plugins)
View
@@ -236,19 +236,21 @@ Ogre::String FaSoundEditorFactory::GetPlaceHolderName()
return "FaSound.mesh";
}
/////////////////////////////////////////////////////////////////////////
-FaSoundEditorFactory *fasoundFac = 0;
bool dllStartPlugin(void *identifier, Ogre::String& name)
{
name = "FaSound Object";
- fasoundFac = OGRE_NEW FaSoundEditorFactory();
- OgitorsRoot::getSingletonPtr()->RegisterEditorFactory(identifier, fasoundFac);
+ OgitorsRoot::getSingletonPtr()->RegisterEditorFactory(identifier, OGRE_NEW FaSoundEditorFactory());
+ return true;
+}
+
+bool dllGetPluginName(Ogre::String& name)
+{
+ name = "FaSound Object";
return true;
}
bool dllStopPlugin(void)
{
- OGRE_DELETE fasoundFac;
- fasoundFac = 0;
return true;
}
View
@@ -78,4 +78,6 @@ class PluginExport FaSoundEditorFactory: public CBaseEditorFactory
extern "C" bool PluginExport dllStartPlugin(void *identifier, Ogre::String& name);
+extern "C" bool PluginExport dllGetPluginName(Ogre::String& name);
+
extern "C" bool PluginExport dllStopPlugin(void);

0 comments on commit a8d53da

Please sign in to comment.