Permalink
Browse files

Allow MonoDevelop to show the 'real' message for ObjectDisposedExcept…

…ion (generator fix). Ref bug #1345
  • Loading branch information...
1 parent 9cc0cc5 commit e8fa8dcafe9c51fe7a2835a06763626aee12c557 @spouliot spouliot committed Oct 7, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/generator.cs
View
@@ -2244,8 +2244,9 @@ public void Generate (Type type)
}
}
if (HasAttribute (mi, typeof (CheckDisposedAttribute))){
- print ("if ({0}.Handle == IntPtr.Zero)", RenderArgs (pars.Take (1)));
- print ("\tthrow new ObjectDisposedException (\"The object was disposed on the event, you should not call Dispose() inside the handler\");");
+ var arg = RenderArgs (pars.Take (1));
+ print ("if ({0}.Handle == IntPtr.Zero)", arg);
+ print ("\tthrow new ObjectDisposedException (\"{0}\", \"The object was disposed on the event, you should not call Dispose() inside the handler\");", arg);
}
indent--;
print ("}");

0 comments on commit e8fa8dc

Please sign in to comment.