AnsweredAssumed Answered

IWorkspaceExtensionControl.Shutdown - Memory corruption

Question asked by cmk on Jan 10, 2015

Windows, ArcGIS 9.3.1 SP2, Oracle 11.2, .NET C# 3.5


We have a simple workspace extension class that tracks current workspaces.

We have found that if you access any IWorkspace (or other interface it's cast to) property or method while processing the Shutdown callback it will corrupt memory.


The doc's say:

"The Shutdown method informs the workspace extension that the workspace has been released by all clients and is about to go away. In response, the workspace extension should release its reference on the workspace helper. Any subsequent calls by the application to the workspace extension should return an error."


In the shutdown we were getting the IWorkspace from the cached IWorkspaceHelper, then just getting the Name from the IWorkspace (or cast to IVersion to get VersionName) to write to a log.  After doing this we would get random, mainly "pure call", errors.


Believe should either:

1) If not supposed to use IWorkspace in Shutdown the WorkspaceHelper.Workspace should return null.

2) If supposed to be able to use it then fix the memory corruption bug.

and update the documenation accordingly.


Am wondering if this is specific to .NET i.e. maybe the .NET wrapper is no longer usable even if the underlying COM object is.

Am posting in-case others get "pure call" exceptions as this was a fairly trickly bug to find.

Curious if still an issue under 10.x.