|
[Sponsors] |
September 22, 2007, 05:12 |
Hi. I was wondering how to saf
|
#1 |
Senior Member
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17 |
Hi. I was wondering how to safely delete a PtrList? I ask because I have been writing a graphical front-end for blockMesh to display (at the moment) the block structure of a mesh from the blockMeshDict. It works pretty well now; however on exit from the code I get a load of error messages which I interpret as a traceback of an incorrectly-deleted object. There are quite a lot of pointers involved in the code, so I have been working (slowly) through the code making sure all are deleted correctly (something I really hate). However at the base level all the geometric information is held as PtrLists, and it occurred to me that I don't know how to delete these in a safe way. I've tried calling .clear() on them before they go, but that doesn't seem to make any difference. It may be that the error is somewhere else, but if anyone has any suggestions I'm all ears.
Gavin |
|
September 22, 2007, 18:55 |
Nothing to worry about - you h
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Nothing to worry about - you hook (set) pointers into a PtrList and the list itself will worry about the deletion. Your error is elsewhere.
Try running valgrind --tool=memcheck <app> <root> <case> and you will get a more sensible message about first memory violation. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PtrList initialization problem | mateusz_slowikowski | OpenFOAM Running, Solving & CFD | 8 | March 19, 2012 15:32 |
[snappyHexMesh] SnappyHexMesh region deletion | monkeytron | OpenFOAM Meshing & Mesh Conversion | 2 | February 19, 2009 23:57 |
Hook function of PtrList in OF 15 | pawel | OpenFOAM Running, Solving & CFD | 2 | January 9, 2009 04:21 |
What is the equivalent of hook function of PtrList in v14 | liu | OpenFOAM Running, Solving & CFD | 1 | May 30, 2007 18:30 |