Re: [wxVTK] wxVTK and wxWidgets 2.8
Brought to you by:
malat
|
From: Sander N. <nie...@st...> - 2008-01-02 14:09:25
|
On 2 jan 2008, at 14:35, Marco wrote:
> your patch solved both the problems. Is it going to be merged with the
> official wxVTK?
It would be nice, but this is up to Mathieu. Furthermore, I haven't
tested my patch with older versions of wxWidgets/VTK, so I don't know
if it breaks anything there. It may be wise to test it first.
> The patch solved this two problems with wxGTK 2.8, but now, with wxGTK
> 2.8 I have the same problem I have using wxGTK 2.6 (as I wrote on
> another thread). Closing the window the application crashes trying to
> delete the wxVTKRenderWindowInteractor. It seems the use of wxglcanvas
> makes the application not to free the resources correctly on my
> system.
>
> Any idea?
In the destructor of our wxVTKRenderWindowInteractor derived classes
we use the following:
-----
SetRenderWindow(NULL);
SetInteractorStyle(NULL);
// Normally one has to remove a wxVTKRenderWindowInteractor
object using 'window->Delete()',
// but we also would like 'delete window' to work (which is
needed for e.g. Python wrapping)
// This should be safe as long as the reference count is 1 (i.e.
no other objects have a reference to this object)
// The problem is that we can't use Delete() or Unregister(NULL)
here, because that would recursively invoke the
// destructor. Therefore, we just explicitly decrease the
reference count by 1 if it was 1 (this way you will still
// get a warning from VTK if the reference count afterwards was
not 0).
if (GetReferenceCount() == 1)
{
SetReferenceCount(0);
}
-----
However, the samples already seem to use Delete() instead of 'delete',
so perhaps setting the renderwindow and interactorstyle to NULL before
destruction can solve the problem?
> Is there anyone using wxVTK on Ubuntu 7.10?
We are ;)
If you want to see our app (and sources), just download the VISAN
package from our website: http://www.stcorp.nl/beat
We have a version for Linux, Windows, and Mac OS X.
Best regards,
Sander
|