Trados Studio generates error "Object reference not set to an instance of an object" upon exit

In developing a plug-in for Trados Studio, encountering the error "Object reference not set to an instance of an object" upon exit, which references Sdl.TranslationStudio.Editor.TranslationMemory.TranslationProvider.DetachEventListeners().  What might be causing such an error?

The full call stack is as follows.

<StackTrace><![CDATA[   at Sdl.TranslationStudio.Editor.TranslationMemory.TranslationProvider.DetachEventListeners()
   at Sdl.TranslationStudio.Editor.TranslationMemory.TranslationProvider.Dispose()
   at Sdl.TranslationStudio.Editor.TranslationEditor.TranslatableDocument.OnClosed()
   at Sdl.TranslationStudio.Api.Editor.AbstractInternalDocument.CloseImpl()
   at Sdl.TranslationStudio.Api.Editor.AbstractInternalDocument.Close()
   at Sdl.TranslationStudio.Editor.TranslationEditor.TranslatableDocument.Close()
   at Sdl.TranslationStudio.Editor.EditorService.<CloseAllDocuments>b__4e(IDocument t)
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at Sdl.TranslationStudio.Editor.EditorService.CloseAllDocuments()
   at Sdl.TranslationStudio.Editor.EditorService.Window_Closing(IStudioWindow window, CancelEventArgs e)
   at Sdl.Desktop.Platform.StudioWindowCancelEventHandler.Invoke(IStudioWindow window, CancelEventArgs cancel)
   at Sdl.Desktop.Platform.Implementation.StudioWindow.OnClosing()
   at Sdl.Desktop.Platform.Implementation.StudioWindow._form_Closing(Object sender, CancelEventArgs e)
   at System.Windows.Forms.Form.OnClosing(CancelEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at Sdl.Desktop.Platform.WinForms.StudioWindowForm.WndProc(Message& message)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)]]></StackTrace>

Parents Reply
  • It's hard to say without knowing the implementation of you plugin but I can suggest the following:

    1.  Test and see if the error appear if you plugin is not loaded by Trados Studio at startup (remove it from the 2 plugin folders). If the error doesn't appear then you at least know that the problem is related to your plugin.
    2. Comment most of your implementation run it several times by adding parts of the implementation. This can help you narrow down the area that causes problems.

    Based on the exception it looks to me that there might be some resources that are not properly deallocated but this is just a guess.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Children