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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. STL access violation

STL access violation

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 Posts 2 Posters 0 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.
  • S Offline
    S Offline
    s o v a n n
    wrote on last edited by
    #1

    Hello !:) I have a problem in my solution which use extensively STL. When we remove pointer from list<> in A.dll to B.dll [OK] When we put back from B.dll to A.dll [ACCESS VIOLATION] We have : prim.dll, env.dll and app.exe (multithread) [prim.dll]    Shape* newLine(); [app.exe]   list<Shape*> obj; [env.dll]    list<Shape*> undo; The senario : [create line]    Shape* line=newLine(); obj.push_back(line); [delete line]    obj.remove(line); undo.push_back(line); [undo delete]   obj.push_back(undo.front()); [problem ]      obj.front()=0xfeeefeee Object was never delete until now, but we got an invalid pointer. Your idea and comments would be very helpful. Thanks.:)

    S 1 Reply Last reply
    0
    • S s o v a n n

      Hello !:) I have a problem in my solution which use extensively STL. When we remove pointer from list<> in A.dll to B.dll [OK] When we put back from B.dll to A.dll [ACCESS VIOLATION] We have : prim.dll, env.dll and app.exe (multithread) [prim.dll]    Shape* newLine(); [app.exe]   list<Shape*> obj; [env.dll]    list<Shape*> undo; The senario : [create line]    Shape* line=newLine(); obj.push_back(line); [delete line]    obj.remove(line); undo.push_back(line); [undo delete]   obj.push_back(undo.front()); [problem ]      obj.front()=0xfeeefeee Object was never delete until now, but we got an invalid pointer. Your idea and comments would be very helpful. Thanks.:)

      S Offline
      S Offline
      Sebastian Schneider
      wrote on last edited by
      #2

      Did you accidentally mix-up the calls? Maybe you deleted it during one call because you swapped two lines of source? Or you have a , where a ; should be? Cheers, Sebastian -- Contra vim mortem non est medicamen in hortem.

      S 1 Reply Last reply
      0
      • S Sebastian Schneider

        Did you accidentally mix-up the calls? Maybe you deleted it during one call because you swapped two lines of source? Or you have a , where a ; should be? Cheers, Sebastian -- Contra vim mortem non est medicamen in hortem.

        S Offline
        S Offline
        s o v a n n
        wrote on last edited by
        #3

        Thank you for your comments. I would scan for , and ; misplaced. Sovann.

        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