Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
extras
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Openvibe Group
extras
Commits
2655fa82
Commit
2655fa82
authored
9 years ago
by
Jussi Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
Kernel: Fixed freeing of some Ogre resources on exit
- Made some silent exceptions non-silent
parent
1be504c1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kernel/src/kernel/player/ovkCOgreVisualisation.cpp
+28
-8
28 additions, 8 deletions
kernel/src/kernel/player/ovkCOgreVisualisation.cpp
kernel/src/kernel/player/ovkCOgreVisualisation.h
+2
-0
2 additions, 0 deletions
kernel/src/kernel/player/ovkCOgreVisualisation.h
with
30 additions
and
8 deletions
kernel/src/kernel/player/ovkCOgreVisualisation.cpp
+
28
−
8
View file @
2655fa82
...
...
@@ -24,6 +24,7 @@ COgreVisualisation::COgreVisualisation(const OpenViBE::Kernel::IKernelContext& r
,
m_bOgreInitialised
(
false
)
,
m_bResourcesInitialised
(
false
)
,
m_pRoot
(
NULL
)
,
m_pLogManager
(
NULL
)
,
m_pLog
(
NULL
)
,
m_pOverlaySystem
(
NULL
)
{
...
...
@@ -82,10 +83,13 @@ boolean COgreVisualisation::initializeOgre(void) throw (std::exception)
//configure custom log
//--------------------
LogManager
*
l
_pLogManager
=
new
LogManager
();
m
_pLogManager
=
new
LogManager
();
//create custom log
const
CString
l_sLogFile
=
this
->
getConfigurationManager
().
expand
(
"${Kernel_3DVisualisationOgreLogPath}"
);
m_pLog
=
l_pLogManager
->
createLog
(
l_sLogFile
.
toASCIIString
(),
this
->
getLogManager
()
<<
LogLevel_Trace
<<
"Ogre log will be written to ["
<<
l_sLogFile
<<
"]
\n
"
;
m_pLog
=
m_pLogManager
->
createLog
(
l_sLogFile
.
toASCIIString
(),
true
/* is default log */
,
false
/* send log messages to debugger */
,
(
l_sLogFile
==
CString
(
""
)
?
true
:
false
)
/* suppress file log */
);
if
(
!
m_pLog
)
{
...
...
@@ -142,8 +146,7 @@ boolean COgreVisualisation::initializeOgre(void) throw (std::exception)
catch
(
Ogre
::
Exception
&
e
)
{
this
->
getLogManager
()
<<
LogLevel_Trace
<<
"<"
<<
LogColor_PushStateBit
<<
LogColor_ForegroundBlue
<<
"Ogre3D"
<<
LogColor_PopStateBit
<<
"::Exception> "
<<
"Failed to initialize Ogre : "
<<
e
.
what
()
<<
"
\n
"
;
<<
LogLevel_Error
<<
"<Ogre3D::Exception> Failed to initialize Ogre : "
<<
e
.
what
()
<<
"
\n
"
;
}
return
m_bOgreInitialised
;
...
...
@@ -170,8 +173,7 @@ boolean COgreVisualisation::initializeResources() throw (Ogre::Exception)
catch
(
Ogre
::
Exception
&
e
)
{
this
->
getLogManager
()
<<
LogLevel_Trace
<<
"<"
<<
LogColor_PushStateBit
<<
LogColor_ForegroundBlue
<<
"Ogre3D"
<<
LogColor_PopStateBit
<<
"::Exception> "
<<
"Failed to initialize Ogre resources : "
<<
e
.
what
()
<<
"
\n
"
;
<<
LogLevel_Error
<<
"<Ogre3D::Exception> Failed to initialize Ogre resources : "
<<
e
.
what
()
<<
"
\n
"
;
}
m_bResourcesInitialised
=
true
;
...
...
@@ -215,16 +217,34 @@ boolean COgreVisualisation::finish()
itResources
=
m_mOgreResourceGroups
.
begin
();
}
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
if
(
m_pOverlaySystem
)
{
OGRE_DELETE
m_pOverlaySystem
;
m_pOverlaySystem
=
NULL
;
}
#endif
if
(
m_pRoot
!=
NULL
)
{
delete
m_pRoot
;
m_pRoot
=
NULL
;
}
if
(
m_pLog
)
{
m_pLog
->
removeListener
(
this
);
m_pLogManager
->
destroyLog
(
m_pLog
);
m_pLog
=
NULL
;
}
if
(
m_pLogManager
)
{
delete
m_pLogManager
;
m_pLogManager
=
NULL
;
}
}
catch
(
Ogre
::
Exception
)
catch
(
Ogre
::
Exception
e
)
{
//
this
->
getLogManager
()
<<
LogLevel_Error
<<
"<Ogre3D::Exception> During finish() : "
<<
e
.
what
()
<<
"
\n
"
;
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
kernel/src/kernel/player/ovkCOgreVisualisation.h
+
2
−
0
View file @
2655fa82
...
...
@@ -270,6 +270,8 @@ private:
OpenViBE
::
boolean
m_bResourcesInitialised
;
/// Ogre3D root
Ogre
::
Root
*
m_pRoot
;
/// Ogre log manager
Ogre
::
LogManager
*
m_pLogManager
;
/// Ogre log
Ogre
::
Log
*
m_pLog
;
/// Maps scene Ids to scene pointers
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment