]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: only replace ref/unref funcs with better matches
authorEvan Nemerson <evan@nemerson.com>
Wed, 4 Jun 2014 22:01:16 +0000 (15:01 -0700)
committerEvan Nemerson <evan@nemerson.com>
Wed, 4 Jun 2014 22:04:47 +0000 (15:04 -0700)
vala/valagirparser.vala

index b1561e86e33e82fcfd808c4b179b9ba39180f4b2..6af28916dc1979bda84c94f735c0944be849d968 100644 (file)
@@ -3199,9 +3199,9 @@ public class Vala.GirParser : CodeVisitor {
                        } else if (reader.name == "method") {
                                parse_method ("method");
                                var cname = old_current.get_cname ();
-                               if (cname.has_suffix ("_ref")) {
+                               if (cname.has_suffix ("_ref") && (ref_method == null || old_current.name == "ref")) {
                                        ref_method = old_current;
-                               } else if (cname.has_suffix ("_unref")) {
+                               } else if (cname.has_suffix ("_unref") && (unref_method == null || old_current.name == "unref")) {
                                        unref_method = old_current;
                                }
                        } else if (reader.name == "function") {