[gjs: 1/2] arg-cache: Use BoxedInTransferNone::release for GBytesInTransferNone::release
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] arg-cache: Use BoxedInTransferNone::release for GBytesInTransferNone::release
- Date: Thu, 26 May 2022 14:54:42 +0000 (UTC)
commit f43d9d16445967498cd8652f87f5450b81b5bf6a
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 f918ca1a1..1ec48c948 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]