Commit Graph

6 Commits

Author SHA1 Message Date
Andrés G. Aragoneses
8aaed84e5e cairo: Fix remaining leaks when finalizer gets called
Apply same finalizer leak fix to the rest of IDisposable-ownership
cairo classes as the one recently committed for Cairo.Context[1].

[1] https://github.com/mono/gtk-sharp/commit/41eeecbf9a6d8
2013-11-30 15:34:29 +01:00
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
Bertrand Lorentz
21ce761271 cairo: Fix some whitespace and code formatting issues 2013-07-26 17:43:26 -05:00
Michael Hutchinson
bdc2cfdf1d cairo: Clean up Region's Dispose/ctor 2013-07-26 17:43:26 -05:00
Mike Kestner
ee866216b1 Cairo API 1.10 updates.
* cairo/*: merge changes to Mono.Cairo since we split back in Oct 2008.
  Not much changed.  Scrubbed the doc index and updated NativeMethods
  to match.  Commented with DONTCARE the ones we will ignore.  Implemented
  a few of them, including an initial Device binding.  Still some work
  to do, and some discovery to be done to see what happened to Xcb, Glitz,
  and DirectFB surfaces and whether we need to remove those classes.
2011-02-17 23:00:12 -06:00
Mike Kestner
f6d11d67b6 Cairo# 1.10.0 assembly.
* configure.ac: drop cairo conditionality
* cairo/AssemblyInfo.cs: set version to 1.10.0.0
* cairo/Makefile.am: unconditional build and add Region.cs
* cairo/cairo-api.xml: initial type exposure.
* pango/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* pango/Pango.metadata: drop explicit symbol additions.
* gdk/Gdk.metadata: drop explicit symbol additions.
* gdk/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* gtk/Makefile.am: use cairo-sharp.dll and cairo-api.xml
* sample/Makefile.am: use cairo-sharp.dll
* sample/GtkDemo/Makefile.am: use cairo-sharp.dll

This is an initial stab at a 1.10 binding.  It will probably take
more based on the number of errors still coming out of the Gdk
build.
2011-01-30 17:00:03 -06:00