Im using undetermined DLLs which can use undetermined resources such as a COM port.
Some DLL methods don't have their own timeouts, so i am forced to abort the execution thread.
But if the thread is using a resource such as a COM port, and i abort the thread, my program crashes with the error “Safe handle has been closed”. I know why this happens but is there any way to catch this exception or skip it, rather than an actual crash?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…