[vtkusers] Solution: Bug in SetRenderWindow(NULL)
Mathieu Malaterre
Mathieu.Malaterre at creatis.insa-lyon.fr
Wed Oct 22 04:39:08 EDT 2003
de Boer Ingo wrote:
> Hi,
>
> I guess I found the solution for the
> bug/problem in SetRenderWindow(NULL).
> The lines in vtkWin32OpenGLRenderWindow should be:
>
> vtkWin32OpenGLRenderWindow::~vtkWin32OpenGLRenderWindow()
> {
> ...
> if (this->WindowId)
> {
> this->Clean();
> ReleaseDC(this->WindowId, this->DeviceContext);
> // can't set WindowId=NULL, needed for DestroyWindow
> this->DeviceContext = NULL;
>
> // clear the extra data before calling destroy
> vtkSetWindowLong(this->WindowId,4,(LONG)0);
> if (this->OwnWindow)
> DestroyWindow(this->WindowId);
> }
> ...
> }
Hi all,
I have just checked Ingo's patch on my software. And it does fix the
previous problem I reported here:
http://vtk.org/pipermail/vtkusers/2003-October/020528.html
I do not need anymore to call 'SetRenderWindow(NULL)' before destroying
a RenderWindow on Win32.
I would really like this patch being applyied in the current VTK CVS
tree. If possible I'll try builing valgrind on cygwin to check
everything is being free...not sure it'll work though...
mathieu
Ps: I include a more 'formal' patch to this problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32.patch
Type: text/x-diff
Size: 869 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20031022/d255d6e1/attachment.patch>
More information about the vtkusers
mailing list