GtkSharp/cairo
Andrés G. Aragoneses 70d1827058 cairo: Throw ObjectDisposedException after an object has been disposed
Potentially all these IDisposable classes could be used after being
disposed, which would result in native crashes. We now do an explicit
check and throw an exception in managed land when the object has been
disposed.

This is particularly useful because:
 a/ the native crashes are quite obscure, there no indication that
you're using a disposed object
 b/ Gtk# is passing Context instances to user methods, and disposes them
when the method returns. So if the user code keeps a reference to the
Context, there a good chance it will try to use it after it's disposed.

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,
and throwing ObjectDisposedExceptions because the object was invalid in
the first place.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2013-11-24 15:56:26 +01:00
..
Antialias.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
AssemblyInfo.cs.in build: Fix API version for cairo and don't hardcode it 2012-07-02 13:56:06 -04:00
cairo-api.xml cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
Cairo.cs Revert a couple files to mono master 2011-04-21 18:01:33 -05:00
cairo.csproj MSBuild: change some projects to Library type, not Executable 2013-09-24 01:24:33 +02:00
CairoDebug.cs cairo: Don't log warnings during VM shutdown 2013-07-26 17:43:26 -05:00
Color.cs cairo: Put some classes in separate files 2013-07-26 17:43:26 -05:00
Content.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Context.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
Device.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
DirectFBSurface.cs cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
Distance.cs cairo: Put some classes in separate files 2013-07-26 17:43:26 -05:00
Extend.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
FillRule.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Filter.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
FontExtents.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
FontFace.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
FontOptions.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
FontSlant.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
FontType.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
FontWeight.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Format.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
GlitzSurface.cs cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
Glyph.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Gradient.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
HintMetrics.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
HintStyle.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
ImageSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
LinearGradient.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
LineCap.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
LineJoin.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Makefile.am cairo: Don't disable the deprecation warnings during compilation 2013-07-26 18:46:43 -05:00
Matrix.cs cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
mono.snk Use -keyfile instead of deprecated attr. 2011-01-07 22:15:04 -06:00
NativeMethods.cs cairo: Fix text API calls 2013-07-26 17:43:27 -05:00
Operator.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Path.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
Pattern.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
PatternType.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
PdfSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
Point.cs cairo: Put some classes in separate files 2013-07-26 17:43:26 -05:00
PointD.cs cairo: Put some classes in separate files 2013-07-26 17:43:26 -05:00
PSSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
RadialGradient.cs cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
Rectangle.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Region.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
ScaledFont.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
SolidPattern.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
Status.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
SubpixelOrder.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Surface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
SurfacePattern.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
SurfaceType.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
SvgSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
SvgVersion.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
TextExtents.cs 2008-10-09 Mike Kestner <mkestner@novell.com> 2008-10-09 23:53:18 +00:00
Win32Surface.cs cairo: Introduce the concept of reference ownership 2013-07-26 17:43:11 -05:00
XcbSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00
XlibSurface.cs cairo: Throw ObjectDisposedException after an object has been disposed 2013-11-24 15:56:26 +01:00