Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Damn that 4kbytes of leak memory

Damn that 4kbytes of leak memory

Scheduled Pinned Locked Moved Managed C++/CLI
graphicsgame-devperformancehelpquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Cutovoi
    wrote on last edited by
    #1

    Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot

    C G 2 Replies Last reply
    0
    • A Alex Cutovoi

      Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      pass a std::String, and then use the c_str() function to get a char * to pass into the OpenGL function. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • A Alex Cutovoi

        Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot

        G Offline
        G Offline
        georgemarios
        wrote on last edited by
        #3

        I suppose that you dynamically allocate the list array before calling ImprimeTexto, and then you forget to deallocate it.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups