[gjs/gnome-42] arg-cache: Use BoxedInTransferNone::release for GBytesInTransferNone::release



commit c0ebeb0a029bee65fb5e6b5780c767c6ea2955e0
Author: msizanoen1 <msizanoen qtmlabs xyz>
Date:   Tue May 24 16:51:15 2022 +0700

    arg-cache: Use BoxedInTransferNone::release for GBytesInTransferNone::release
    
    GBytes parameters in "transfer none" mode needs to be released after the
    function returns, otherwise its reference count will be incremented even
    if the callee doesn't own the reference, causing a memory leak. Fix this
    by using BoxedInTransferNone::release instead of BoxedIn::release which is
    a no-op.
    
    Fixes #483

 gi/arg-cache.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gi/arg-cache.cpp b/gi/arg-cache.cpp
index 84f08bee2..df7cd1c67 100644
--- a/gi/arg-cache.cpp
+++ b/gi/arg-cache.cpp
@@ -599,7 +599,7 @@ struct GBytesInTransferNone : GBytesIn {
     using GBytesIn::GBytesIn;
     bool release(JSContext* cx, GjsFunctionCallState* state, GIArgument* in_arg,
                  GIArgument* out_arg) override {
-        return BoxedIn::release(cx, state, in_arg, out_arg);
+        return BoxedInTransferNone::release(cx, state, in_arg, out_arg);
     }
 };
 


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