AccessViolationException on program shutdown

3 posts / 0 new
Last post
Last seen: 6 years 5 months ago
Joined: 06/25/2013
Posts: 5
AccessViolationException on program shutdown


I'm encountering the following unhandled exception in nddsdotnet40.dll when my application shuts down:

System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at DDS.WaitSet.!WaitSet()
at DDS.WaitSet.Dispose(Boolean )
at DDS.WaitSet.Finalize()

I've traced through all my Dispose() methods and it doesn't seem that anything is directly causing this exception.

I dispose of my domain participant by calling:

DomainParticipantFactory.get_instance().delete_participant(ref participant);

The code executes with no problems, my window closes, and then I see the exception in my Visual Studio debugger.

I don't use WaitSets in my application, so I wonder if it is something internal that is not being disposed properly?

Thanks in advance for your help.

Last seen: 6 years 5 months ago
Joined: 06/25/2013
Posts: 5

Here is some debugging information that may be useful.

jmorales's picture
Last seen: 2 months 1 week ago
Joined: 08/28/2013
Posts: 40

Hello jsacks,

The message you are getting is usually related with trying to access to a deleted object. Are you using threads that make the application try to delete the participant several times?

Also, are you using Request-Reply? I ask this because your stack trace shows a call to WaitSet.dispose and you are not using any. Request-Reply internally uses waitsets, so this would be an explanation of getting this message.