[vala] girparser: only replace ref/unref funcs with better matches



commit 5dc6448fb40f9d44faf4e285b9d9ddc16a29d140
Author: Evan Nemerson <evan nemerson com>
Date:   Wed Jun 4 15:01:16 2014 -0700

    girparser: only replace ref/unref funcs with better matches

 vala/valagirparser.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index b1561e8..6af2891 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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") {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]