<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The only thing is not clear for me is how to force smartpointer to<br>
release the data.<br><br></blockquote><div><br></div><div>Is this what you're looking for?</div><div><br></div><div>vtkSmartPointer<vtkType> sp = vtkSmartPointer<vtkType>::New();</div><div>...</div><div>sp = NULL; // Release would happen here.</div>
<div><br></div><div>This would decrement the reference count of the object by one. If no one else holds a reference count of the object (i.e. reference count goes to zero), it will be released from memory.</div><div><br></div>
<div>Normally you just wait for the smart pointer to go out of scope. If you explicitly need to make the reference go away at a certain point, you might as well not use smart pointers and just do this equivalent code:</div>
<div><br></div><div>vtkType* p = vtkType::New();</div><div>...</div><div>p->Delete();</div><div><br></div><div>Jeff</div></div>