Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

subscriber unsubscribes just before a callback is made

$
0
0

Hi all

i have few subscribers listening for events, the problem is in some scenarios it unsubscribes, just before a call is made to it, thus throwing a null reference exception.

Psedo code void InvokeCallback( ) { if(callback != NULL) { //At this point the subscriber unsubscribes and now the pointer is

// null and it crashes with null reference exception,

// can anyone tell me how to fix this issue. callback(...with paramerters..); } }





Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images