mono/gtk-sharp — pull request #93 by knocte (2013-11-04 23:23:13+00:00)
Title: cairo: throw ObjectDisposedException after an object has been disposed

Potentially all this IDisposable classes could be used after being
disposed, which would result in native crashes. This way we avoid
this and would throw an exception in managed land instead.

Other changes in this patch include:
- Renaming a parameter to be more consistent with the other subsequent
ctor called.
- Replacing implementation of some [Obsolete()] methods with the call
to the methods they were replaced with, to avoid redundancy and the
need for more CheckDisposed() calls than necessary.
- Throw ArgumentException when receiving an IntPtr.Zero as a handle,
as a way to protect ourselves from wrapping invalid native pointers,
or throwing ObjectDisposedExceptions when the object was not disposed
but invalid in the first place.