|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#19
|
|||
|
|||
|
Re: SmartDashboard Crashing
I'm not sure it's a memory leak. I got some additional debug information, but I'm no java expert. I think the problem is below. What happens if cam.getNewImage returns NULL? Because based on the traceback I got that's what appears to be happening. I don't see an explicit check to validate that we got an image (but I haven't looked at the getNewImage code), but if it does get a NULL, then it explains the access violation.
Any java coders out there that can help? try { image = cam.getNewImage(5.0); if (image instanceof WPIColorImage) { drawnImage = processImage((WPIColorImage) image).getBufferedImage(); SwingUtilities.invokeLater(draw); } else if (image instanceof WPIGrayscaleImage) { drawnImage = processImage((WPIGrayscaleImage) image).getBufferedImage(); SwingUtilities.invokeLater(draw); } } catch (final Exception e) { e.printStackTrace(); cam.dispose(); cam = null; drawnImage = null; SwingUtilities.invokeLater(draw); try { Thread.sleep(2000); } catch (InterruptedException ex) { } } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|