<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Bruno, <br>
<blockquote
cite="mid:CAO-SbSvbO3efWNsC_tPrhrPLxLFHfy+diS3hMN1gFZscQHxzSg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>hello,<br>
<br>
</div>
I am doing the following experiment:<br>
<br>
osg::ref_ptr<osg::Vec3Array> array(new
osg::Vec3Array);<br>
</div>
array->resize(300000000);<br>
</div>
array->clear();<br>
<br>
</div>
This does not deallocate the memory.<br>
</div>
</div>
</blockquote>
It is "detaching" the memory. There is no guarantee the memory is
actually freed at this point (see std::vector)<br>
The only safe way to "de"-allocate a std::vector is to get it out of
scope or swap it with an empty vector.<br>
Note that for c++11 there is also a shrink_to_fit.<br>
<br>
Cheers<br>
Sebastian <br>
<blockquote
cite="mid:CAO-SbSvbO3efWNsC_tPrhrPLxLFHfy+diS3hMN1gFZscQHxzSg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
How do I effectively deallocate the memory from the std::vector
encapsulated in the osg::Vec3Array?<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
</body>
</html>