STL access violation
-
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.:)
-
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.:)
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.
-
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.
Thank you for your comments. I would scan for , and ; misplaced. Sovann.