mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:15:32 +00:00
Fix a possible memory leak in error case
This commit is contained in:
parent
e6619c5306
commit
446c714727
1 changed files with 4 additions and 4 deletions
|
@ -352,13 +352,13 @@ public:
|
|||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(nv);
|
||||
osg::RefMatrix* projectionMatrix = new osg::RefMatrix(*cv->getProjectionMatrix());
|
||||
float fov, aspect, zNear, zFar;
|
||||
if (projectionMatrix->getPerspective(fov, aspect, zNear, zFar))
|
||||
if (cv->getProjectionMatrix()->getPerspective(fov, aspect, zNear, zFar))
|
||||
{
|
||||
fov = mFov;
|
||||
projectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
||||
cv->pushProjectionMatrix(projectionMatrix);
|
||||
osg::RefMatrix* newProjectionMatrix = new osg::RefMatrix(*cv->getProjectionMatrix());
|
||||
newProjectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
||||
cv->pushProjectionMatrix(newProjectionMatrix);
|
||||
traverse(node, nv);
|
||||
cv->popProjectionMatrix();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue