.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Long hangup between DocumentToBeDestroyed and DocumentDestroyed Events

1 REPLY 1
Reply
Message 1 of 2
Anonymous
344 Views, 1 Reply

Long hangup between DocumentToBeDestroyed and DocumentDestroyed Events

Have a major issue, and cannot figure out the cause.

 

I've created a palette that controls several things, but ultimately connects to a Sql database with block information, etc.

 

When I close a document, the DocumentToBeDestroyed event fires, runs through the associated code without any errors, then hangs for more than 2 minutes (I timed it). This obviously would lead most users to assume the program has frozen. After the hang concludes, the DocumentDestroyed event fires and runs through it's associated code without any errors. 

 

When I break the code in the middle of the hang, I get this message: 

 

mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadaffinity, bool exitContext) + 0x14 bytes.

 

I understand the principle of threading, if not how to do it, do it seems to me that ACAD is running something behind the scenes between the two events that is taking a ridiculously long time.

 

Any explanation or help would be great.

 

 

1 REPLY 1
Message 2 of 2
DiningPhilosopher
in reply to: Anonymous

Your code is causing the hangup. Without seeing it, there's not much anyone can tell you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report