Closed paulvi closed 11 years ago
I also got once the same Exception when right-click select Generate Markdown Preview from within Editor.
These NPE's are most likely arising due to some anomalies in how the life-cycle for the GfmView
class is being handled. Eclipse views aren't meant to have regular constructors, rather the createPartControl
and dispose
methods should manage its state. I think calls are being made to methods like generateIFolder
after dispose
has been called, and as this latter method sets the gfmTransformer
instance variable to null (to free garbage) an NPE will occur for every file in the folder.
The NPE's also happens if the view has been constructed, but createPartControl
has not been called - which can happen!
A fair bit of refactoring will be required to disentangle the responsibilities of this class...
Since I have been using GFM Viewer, I think I have not run into this error. So it may be introduced with newer changes (as it often happens).. But you are to know better where ...
For me also it seems that to dispose View with Browser inside (and then create it again) is resource waste. Not to mention that because of using native code, the may be memory leaks and some instabilities. Is it possible to have gradual dispose?
BTW, I wonder is 10 times the snippet below a Eclipse bug? It is really excessive.
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
If we can reproduce we should report.
Fixed in 1.4.0.
Steps to reproduce