[vtkusers] Problem about exit from vtkTkRenderWidget

im01_peg at nada.kth.se im01_peg at nada.kth.se
Mon Dec 2 02:33:02 EST 2002


Hi All vtkusers,
Now I meet a problem when using vtkTkRenderWidget, I got a error message
when exit program, saying
"Generic Warning: In D:\VTK\Rendering\vtkTkRenderWidget.cxx, line 626
A TkRenderWidget is being destroyed before it associated vtkRenderWindow
is destroyed.
This is very bad and usually due to the order in which objects are being
destroyed.
Always destroy the vtkRenderWindow before destroying the user interface
components."

Here is part of my code:
	vtkRenderWindow renWin
	puts "Start:  [renWin GetReferenceCount]" ;#Get value 1

	set ren [vtkTkRenderWidget $root.ren -width 500 -height 500 -rw renWin]
      puts "2nd:  [renWin GetReferenceCount]"  ;#Get value 2

	::vtk::bind_tk_render_widget $ren
	puts "3rd:  [renWin GetReferenceCount]" ;# Get Value 3

And I read the file vtkTkRenderWidget.cxx, find that if netRefCount = 
self->RenderWindow->GetReferenceCount()>2, then a error message will pop
up when exit the program. I guest that I should do sth according to
::vtk::bind_tk_render_widget, but where can I find this command and its
opponent in VTK?
I am using VTK40, ActiveTcl 8.3.4.3, WinNT 4.0 workstation.

Thanks for your help!

Grand Pei






More information about the vtkusers mailing list