diff options
author | Johan Bilien <jobi@litl.com> | 2010-01-14 17:02:36 -0500 |
---|---|---|
committer | Johan Bilien <jobi@litl.com> | 2010-01-14 19:20:53 -0500 |
commit | 18d8b801792595760e2695dedae868db6e5b22d8 (patch) | |
tree | 5fca7de10b5c9aaaa65961f6787e1d0bc9968a10 /giscanner | |
parent | 3c24bd60ae2b1f5326893a3e85a664255e298377 (diff) | |
download | gobject-introspection-18d8b801792595760e2695dedae868db6e5b22d8.tar.gz |
scanner: Always explicitely set the scope of callbacks
default to 'call' as stated in the annotation documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=607026
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/annotationparser.py | 2 | ||||
-rw-r--r-- | giscanner/transformer.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index d91bb1c4..aa04ef44 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -507,7 +507,7 @@ class AnnotationApplier(object): def _parse_param(self, parent, param, tag): options = getattr(tag, 'options', {}) - if isinstance(parent, Function) and not param.scope: + if isinstance(parent, Function): scope = options.get(OPT_SCOPE) if scope: param.scope = scope.one() diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 1024ee35..f31408fa 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -295,6 +295,10 @@ class Transformer(object): if not self._type_is_callback(param.type): continue + # set a default scope + if param.scope is None: + param.scope = 'call' + # j is the index where we look for closure/destroy to # group with the callback param j = i + 1 |