Posted by
Michael Schmid on
Sep 07, 2020; 12:25pm
URL: http://imagej.273.s1.nabble.com/GenericDialog-and-imagej-lockups-tp5023908p5023913.html
Hi Fred,
not a clear solution, but one of the threads causing the deadlock is
related to closing an image. Please check your WindowListener!
(1) Is it guaranteed that you call removeWindowListener before
Diffusion_Multimodal exits?
(Note that it does not hurt to call a 'remove' from a listener too
often. It does hurt to call 'add' for a listener more than once, because
then the listener will be entered more than once, get callbacks more
than once, and must be removed more than once).
(2) If Diffusion_Multimodal has ended and its windowClosed or
WindowClosing method would get called, could it do something that (i)
makes it hang or (ii) leads to something being called on the EventQueue
or something that modifies the screen?
(3) If you use any swing calls (jvax.swing, not AWT), note that swing is
not thread-safe. Typically, you should call swing functions only via
SwingUtilities.invokeLater.
Michael
________________________________________________________________
On 04.09.20 21:33, Fred Damen wrote:
> Greetings,
>
> I am able to consitently get imagej to lock up, and I am a loss at what I
> am directly or indirectly doing to cause this. The scenario is:
> my plugin DICOM_open creates a GenericDialog with an addDialogListener,
> which displays and after showDialog returns opens a set of DICOM files as
> a hyperstack. After this I run another plugin, Diffusion_Multimodal,
> which creates a GenericDialog and after the showDialog processes this
> hyperstack creating a set of images in windows; these windows have
> listeners - method that add and removes listener is below. Closing the
> hyperstack and running DICOM_open again causes imagej to lockup within
> showDialog, see first entry in thread stack traces.
>
> I can run DICOM_open only, over and over again, without any lockup. I can
> run Diffusion_Multimodal, after the first DICOM_open, over and over again
> without any lockup. Although, running DICOM_open after
> Diffusion_Multimodal lockups everytime. I have run this code lots and
> lots in the past and do not remember this scenario ever happening.
>
> I discovered this on release 1.52u14 and confirmed it still happens on
> 1.53e14. Any insites and / or suggestion on how to debug this would be
> greatly appriciated.
>
> Thanks in advance,
>
> Fred
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html