Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Dispose timeouts when disposing ServiceCache#5

Open
sharpmonkey wants to merge 1 commit intomono:masterfrom
sharpmonkey:master
Open

Dispose timeouts when disposing ServiceCache#5
sharpmonkey wants to merge 1 commit intomono:masterfrom
sharpmonkey:master

Conversation

@sharpmonkey
Copy link
Copy Markdown

When Client object ref is disposed before all ServiceCache services timeout callbacks have been processed exception is thrown:
System.NullReferenceException: Object reference not set to an instance of an object.
at Mono.Ssdp.Internal.ServiceCache.Remove(String usn, Boolean fromTimeout)
at Mono.Ssdp.Internal.ServiceCache.TimeoutHandler(Object state, TimeSpan& interval)
at Mono.Ssdp.Internal.TimeoutDispatcher.TimerThread(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

This commit addresses such scenarios with calling Dispose on timeouts when ServiceCache Dispose is called.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant