[vtkusers] vtkCocoaRenderWindowInteractor - memory violation when dealloc

Boxer, Aaron Aaron.Boxer at uhn.ca
Thu Jan 30 12:33:55 EST 2014


Bingo!  Thank you!   This also fixes the problem with the small white windows.

Aaron

-----Original Message-----
From: David Gobbi [mailto:david.gobbi at gmail.com] 
Sent: Thursday, January 30, 2014 12:22 PM
To: Boxer, Aaron
Cc: VTK Users
Subject: Re: [vtkusers] vtkCocoaRenderWindowInteractor - memory violation when dealloc

Hi Aaron,

In the code sample that you sent a few emails ago, it looked like you were passing the window Id to SetWindowId() and passing the NSView id to SetDisplayId().  I'm pretty sure that is incorrect.  The documentation for vtkCocoaGLWindow says the following:

SetWindowId(void *):
  Sets the NSView* associated with this vtkRenderWindow.
  This class' default behaviour, that is, if you never call this
  SetWindowId()/SetRootWindow() is to create an NSWindow
  and a vtkCocoaGLView (NSView subclass) which are used
  together to draw all vtk stuff into. If you already have an
  NSWindow and NSView and you want this class to use them
  you must call both SetRootWindow() and SetWindowId(),
  respectively, early on (before WindowInitialize() is executed).
  In the case of Java, you should call only SetWindowId().

When I use vtkCocoaGLWindow, I only use SetWindowId(), and I pass it a pointer to an NSView (never a pointer to an NSWindow).  I don't have to do anything special to get a clean destruction.  But I'm using Cocoa via Qt, so YMMV.

 David

This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. 
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. 
If you have received this e-mail in error, please contact the sender and delete all copies. 
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.



More information about the vtkusers mailing list