Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tags in this Discussion

nvsgTerminate
  • I followed this discussion: http://forum-archive.developer.nvidia.com/index.php?showtopic=4991&hl=nvsgTerminate

    I have the following output :
    ***Memory Leak Detected*** Source: unknown location, Ptr: 0x0BECDB48 (124) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0BEF4EC8 (52) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0BEF4EFC (52) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE1008 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE5008 (136) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE1048 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE1088 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAED7C0 (200) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE10C8 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAF9F38 (116) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE1108 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DB02010 (212) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE12C8 (64) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DB418F0 (344) bytes.
    ****Memory Leak Detected*** Source: unknown location, Ptr: 0x0DAE1308 (64) bytes.

    ......................
    ......................


    but unknown location is not helpful, how do i enable the debugger to show me the locations?

    I tried to reset/delete all objects that contain a scenix sharedPtr, for example I have a :
    nvsg::ViewStateSharedPtr m_viewstate; in Object X
    so when ~X is called I do : m_viewstate.reset();

    Any suggestions?

    thanks!
  • 7 Comments sorted by
  • That link is from SceniX 6 which didn't have the SharedPtr and SmartPtr everywhere yet.
    Please follow the advice at the bottom of this forum entry:
    http://forum-archive.developer.nvidia.com/index.php?showtopic=6643

    That could be a global variable as listed in that post.
    Other than that, I cannot say what's going on in your case. Make sure all PDBs are in the matching folder.

    Repeating Andreas' explaination on the old forum to you, there should be no need to clean up resources with reset() if SharedPtr are members in classes. SharedPtrs are automatically deleted whenever their refCount drops to zero, which will happen inside the destructor.
    (Unless they are still used somewhere else and then the are deleted when the holding class/scene/renderer/whatever gets destroyed.)

    If you meticulously put local scopes around every local SharedPtr (and Read/WriteLocks) there are only a few cases where reset() is really needed at all (e.g. global variables or with screwy exits of main event loops).

    If cleaning up your source code with these guidelines does not solve these reports, send a minimal reproducer project to SceniX-Help(at)nvidia.com and we can take a look. (Note that ZIP archives need to be renamed or they get blocked.)
  • FYI
    It was a global variable , I found It and now scenix terminates :-)

    I have a related issue of GL ERROR when my scenix renderer destructor is called


    ~MyScenixRenderer()
    {
    GLenum lastError;
    lastError = glGetError();
    ASSERT_GL_NO_ERROR;
    .....
    .....
    nvsgTerminate();
    }

    -->lastError = 1282

    Im looking for that , and than i can release glObjects as well , i.e:
    m_highlightFBO.reset();

    m_rendererHighlight.reset();

    m_rendererStencilToColor.reset();

    m_sceneRendererHighlight.reset();

    But If I release them prior to this gl error I succeeded terminating.

  • Calling a glGetError() while there is no OpenGL context made current will incorrectly throw an error in Microsoft's opengl32.dll OpenGL API interface implementation instead if ignoring all OpenGL calls in that case.
    Make sure there is an OpenGL context current when calling OpenGL functions.
    Also please use the SceniX capital-GL wrapper functions (here GLGetError()).
  • Vote Up0Vote Down eliyam30eliyam30
    Posts: 78 Accepted Answer
    >>"Calling a glGetError() while there is no OpenGL context made current will incorrectly throw an error"
    I have a current context when calling to release gl objects:

    nvgl::SmartRenderContextGL cntxt = m_renderContextGL->getCurrentRenderContextGL();

    --> cntxt !=0
    So Its not an issue of current context.

    I have trouble releasing them due to a
    ASSERT_GL_NO_ERROR
    In GLContext.h::

    inline void GLDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
    {
    NVSG_ASSERT(GLIsExtensionAvailable("GL_EXT_framebuffer_object"));
    glContext()->m_glFunctions->glDeleteFramebuffers(n, framebuffers);
    ASSERT_GL_NO_ERROR;
    }


  • Not enough information.
    Make sure you have an OpenGL context current around the reset() functions which free GL resources.
  • Vote Up0Vote Down eliyam30eliyam30
    Posts: 78 Accepted Answer
    Ok, I had a lesson on gl context(s).
    The problem was as you mentioned earlier, not having a current context, but with a twist ,
    I had 2 contexts.
    one was headless, and it was sharing main context, and I didnt properly release it.
    So after debugging that -> scenix terminates :-)

    thanks for the help!