Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dispose method calls itself for no reason Pin
MidwestLimey5-Jan-09 11:50
professionalMidwestLimey5-Jan-09 11:50 
GeneralRe: Dispose method calls itself for no reason Pin
mirko865-Jan-09 12:08
mirko865-Jan-09 12:08 
GeneralRe: Dispose method calls itself for no reason Pin
Luc Pattyn5-Jan-09 12:55
sitebuilderLuc Pattyn5-Jan-09 12:55 
GeneralRe: Dispose method calls itself for no reason Pin
mirko865-Jan-09 13:13
mirko865-Jan-09 13:13 
GeneralRe: Dispose method calls itself for no reason Pin
mirko865-Jan-09 13:26
mirko865-Jan-09 13:26 
GeneralRe: Dispose method calls itself for no reason Pin
Luc Pattyn5-Jan-09 13:44
sitebuilderLuc Pattyn5-Jan-09 13:44 
GeneralRe: Dispose method calls itself for no reason Pin
mirko865-Jan-09 13:54
mirko865-Jan-09 13:54 
GeneralRe: Dispose method calls itself for no reason Pin
Luc Pattyn5-Jan-09 13:38
sitebuilderLuc Pattyn5-Jan-09 13:38 
Hi,

a program running fine most of the time probably indicates it is mostly correct;
however a single failure indicates it is not completely correct.

IIRC you mentioned a null ref exception and a Dispose being called twice; I do not understand how these fit together though, a correct Dispose is protected against null refs; and maybe the double Dispose is due to Dispose() calling Dispose(bool)?

Anyway, you have only two handles to the problem: source code review, and analysis of the symptoms.

Once you know the exact line (and calling context) where the fatal exception occurs,
and assuming you have the source, you could add logging information writing lots of
useful stuff to a file, so next time it fails you can work from there.

If it really is a null ref, it should be rather easy to figure which reference is bogus,
and then analyze how that is possible...

FWIW: Are you sure your try-catch constructs don't discard exception information,
i.e. if a catch block is empty, an earlier exception may got consumed unnoticed, making it much harder to figure out what caused later symptoms.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Love, happiness and fewer bugs for 2009!


GeneralRe: Dispose method calls itself for no reason Pin
mirko865-Jan-09 13:50
mirko865-Jan-09 13:50 
GeneralRe: Dispose method calls itself for no reason Pin
Luc Pattyn5-Jan-09 14:37
sitebuilderLuc Pattyn5-Jan-09 14:37 
GeneralRe: Dispose method calls itself for no reason Pin
MidwestLimey5-Jan-09 14:30
professionalMidwestLimey5-Jan-09 14:30 
GeneralRe: Dispose method calls itself for no reason Pin
Mark Churchill5-Jan-09 16:40
Mark Churchill5-Jan-09 16:40 
AnswerRe: Dispose method calls itself for no reason Pin
Jon Rista6-Jan-09 10:26
Jon Rista6-Jan-09 10:26 
GeneralRe: Dispose method calls itself for no reason Pin
mirko866-Jan-09 11:08
mirko866-Jan-09 11:08 
GeneralRe: Dispose method calls itself for no reason Pin
Jon Rista6-Jan-09 11:45
Jon Rista6-Jan-09 11:45 
GeneralRe: Dispose method calls itself for no reason Pin
mirko866-Jan-09 11:57
mirko866-Jan-09 11:57 
GeneralRe: Dispose method calls itself for no reason Pin
mirko866-Jan-09 12:37
mirko866-Jan-09 12:37 
QuestionHow to use C# class library dll controls in C++ Win32 project Pin
atisman5-Jan-09 10:10
atisman5-Jan-09 10:10 
AnswerRe: How to use C# class library dll controls in C++ Win32 project Pin
EliottA5-Jan-09 10:13
EliottA5-Jan-09 10:13 
Question[Message Deleted] Pin
Vady_15-Jan-09 9:47
Vady_15-Jan-09 9:47 
AnswerRe: Hii Allll !!!! Pin
#realJSOP5-Jan-09 10:29
professional#realJSOP5-Jan-09 10:29 
GeneralRe: Hii Allll !!!! Pin
EliottA5-Jan-09 10:55
EliottA5-Jan-09 10:55 
GeneralRe: Hii Allll !!!! Pin
User 66585-Jan-09 11:22
User 66585-Jan-09 11:22 
GeneralRe: Hii Allll !!!! Pin
vaghelabhavesh5-Jan-09 13:02
vaghelabhavesh5-Jan-09 13:02 
JokeRe: Hii Allll !!!! Pin
Silvyster5-Jan-09 13:45
Silvyster5-Jan-09 13:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.