Commit graph

7 commits

Author SHA1 Message Date
Mikkel Kruse Johnsen f861aeb27b Merge from upstream 2016-07-25 14:39:39 +02:00
Stephan Sundermann 8e0de299e4 generator: Set Owned to false when ownership of a parameter changes
This fixes an issue where unref would get called too often because the
ownership has changed when passing an instance to the native side.

See https://github.com/mono/gtk-sharp/pull/112 for more details.
2014-08-10 18:35:19 +02:00
Bertrand Lorentz e48ac63d54 generator: Dispose ownable method parameters in VM callback (bxc#237)
Some virtual methods are passed a native object that is wrapped in an
IDisposable managed object, which is then passed on to the managed
overrides. We need to dispose those objects as soon as possible,
otherwise their native counterpart will not be freed until the next
garbage collection. Requiring the overrides to dispose them would be
cumbersome and error-prone.

Those parameters will now be disposed in a finally {...} block, after
the virtual method has returned. This means that overrides should not
keep a reference to such a parameter outside of the scope of the method,
as it will be diposed when the method returns.

This change only affects Cairo.Context parameter for now, but it was
particularly needed for them, as they could happily hold on to tens of
MBs of memory until the next garbage collection.
2013-11-09 16:26:17 +01:00
Stephan Sundermann 72b51cc712 generator: Implement attribute to hide method parameters
A hidden parameter is dropped from the signature and the default value is filled in.
2013-10-11 23:36:20 +02:00
Stephan Sundermann 388a2fe659 generator: added handling of optional parameters 2013-10-09 15:31:10 +02:00
Stephan Sundermann 3eefa37272 generator: Bumped parser_version to 3
Added support for new closure and destroy attributes from which we can
determine which callback a parameter belongs to.
2013-10-08 15:39:31 +02:00
Bertrand Lorentz d467cce6e6 generator: Move some classes from Parameters.cs into their own file
This is just code being moved around, there are no real code changes.
2012-11-03 15:46:06 +01:00