Skip to content
Commits on Source (15)
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2020 Philip Chimento <philip.chimento@gmail.com>
/tools/node_modules
Version 1.72.1
--------------
- Various fixes ported from the development branch.
- Closed bugs and merge requests:
* Compilation error: call to deleted function 'js_value_to_c' [#473, !738,
Evan Miller]
* jsapi-util-strings: Ignore locale to compute the upper case of a char (i.e.
fix implicit properties on Turkish locale) [!742, Marco Trevisan]
* Fix memory leak when passing a "transfer none" GBytes parameter to a native
function [!746, msizanoen1]
* arg-cache: Do not leak an interface info structures on Callbacks [!751,
Marco Trevisan]
* test-ci: Ignore safe directory errors on CI [!755, Marco Trevisan]
Version 1.72.0
--------------
......@@ -17,7 +33,7 @@ Version 1.71.90
* GNOME Shell crashes at startup with the AppIndicator extension enabled
[#466, !729, Marco Trevisan]
* Instances of classes implementing interfaces can override functions for all
implentations of an interface [#467, !730, Evan Welsh]
implementations of an interface [#467, !730, Evan Welsh]
* package: Reverse order of running-from-source checks [!734, Philip Chimento]
* Various maintenance [!735, Philip Chimento]
* Various maintenance [!736, Evan Welsh]
......
gjs (1.72.1-0~ubuntu22.04.1) jammy; urgency=medium
* New upstream release (LP: #1981722)
-- Jeremy Bicha <jbicha@ubuntu.com> Thu, 14 Jul 2022 17:01:31 +0200
gjs (1.72.0-3~ubuntu22.04.2) jammy; urgency=medium
* Cherry-pick patch to fix memory leak seen when taking screenshots
......
From: msizanoen1 <msizanoen@qtmlabs.xyz>
Date: Tue, 24 May 2022 16:51:15 +0700
Subject: 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
(cherry picked from commit f43d9d16445967498cd8652f87f5450b81b5bf6a)
---
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 83c4ad4..bf08e53 100644
--- a/gi/arg-cache.cpp
+++ b/gi/arg-cache.cpp
@@ -596,7 +596,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);
}
};
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Thu, 28 Apr 2022 19:53:59 +0200
Subject: jsapi-util-strings: Ignore locale to compute the upper case of a
char
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
We used to compute camel-case name of properties using toupper(),
however this is locale-dependent, while in this case we want to be sure
that we're only using ASCII values.
This is particularly problematic in Turkish (and maybe other locales)
because there 'i'.toLocaleUpperCase() is 'İ', that is definitely not an
ASCII char, causing problems to with our generated properties.
See: https://github.com/micheleg/dash-to-dock/issues/1687
Origin: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/742
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gjs/+bug/1969838
---
gjs/gjs_pch.hh | 1 -
gjs/jsapi-util-string.cpp | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/gjs/gjs_pch.hh b/gjs/gjs_pch.hh
index 46bea8a..6f1b0b4 100644
--- a/gjs/gjs_pch.hh
+++ b/gjs/gjs_pch.hh
@@ -28,7 +28,6 @@
#include <vector>
#include <assert.h>
-#include <ctype.h>
#include <errno.h>
#include <ffi.h>
#include <gio/gio.h>
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index c78069a..a39a0c0 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -4,7 +4,6 @@
#include <config.h>
-#include <ctype.h> // for toupper
#include <stdint.h>
#include <string.h> // for size_t, strlen
#include <sys/types.h> // for ssize_t
@@ -59,7 +58,7 @@ GjsAutoChar gjs_hyphen_to_camel(const char* str) {
if (*input_iter == '-') {
uppercase_next = true;
} else if (uppercase_next) {
- *output_iter++ = toupper(*input_iter);
+ *output_iter++ = g_ascii_toupper(*input_iter);
uppercase_next = false;
} else {
*output_iter++ = *input_iter;
jsapi-util-strings-Ignore-locale-to-compute-the-upper-cas.patch
arg-cache-Use-BoxedInTransferNone-release-for-GBytesInTra.patch
......@@ -226,8 +226,10 @@ struct Array : BasicType {
};
struct BaseInfo {
explicit BaseInfo(GIBaseInfo* info)
: m_info(info ? g_base_info_ref(info) : nullptr) {}
constexpr explicit BaseInfo(GIBaseInfo* info,
const GjsAutoTakeOwnership& add_ref)
: m_info(info, add_ref) {}
constexpr explicit BaseInfo(GIBaseInfo* info) : m_info(info) {}
GjsAutoBaseInfo m_info;
};
......@@ -251,7 +253,8 @@ struct RegisteredType {
struct RegisteredInterface : BaseInfo {
explicit RegisteredInterface(GIBaseInfo* info)
: BaseInfo(info), m_gtype(g_registered_type_info_get_g_type(m_info)) {}
: BaseInfo(info, GjsAutoTakeOwnership{}),
m_gtype(g_registered_type_info_get_g_type(m_info)) {}
constexpr GType gtype() const { return m_gtype; }
......@@ -259,8 +262,8 @@ struct RegisteredInterface : BaseInfo {
};
struct Callback : Nullable, BaseInfo {
explicit Callback(GITypeInfo* type_info)
: BaseInfo(g_type_info_get_interface(type_info)),
constexpr explicit Callback(GIInterfaceInfo* info)
: BaseInfo(info, GjsAutoTakeOwnership{}),
m_scope(GI_SCOPE_TYPE_INVALID) {}
inline void set_callback_destroy_pos(int pos) {
......@@ -555,7 +558,7 @@ struct UnregisteredBoxedIn : BoxedIn, BaseInfo {
explicit UnregisteredBoxedIn(GIInterfaceInfo* info)
: BoxedIn(g_registered_type_info_get_g_type(info),
g_base_info_get_type(info)),
BaseInfo(info) {}
BaseInfo(info, GjsAutoTakeOwnership{}) {}
// This is a smart argument, no release needed
GIBaseInfo* info() const override { return m_info; }
};
......@@ -596,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);
}
};
......@@ -2171,8 +2174,8 @@ void ArgsCache::build_arg(uint8_t gi_index, GIDirection direction,
common_args, DESTROY_NOTIFY_NO_CALLBACK);
*inc_counter_out = false;
} else {
auto* gjs_arg =
set_argument_auto<Arg::CallbackIn>(common_args, &type_info);
auto* gjs_arg = set_argument_auto<Arg::CallbackIn>(
common_args, interface_info);
int destroy_pos = g_arg_info_get_destroy(arg);
int closure_pos = g_arg_info_get_closure(arg);
......
......@@ -479,7 +479,7 @@ gjs_value_to_g_value_internal(JSContext *context,
return throw_expect_type(context, value, "integer");
}
} else if (gtype == G_TYPE_INT64) {
gint64 i;
int64_t i;
if (Gjs::js_value_to_c_checked<int64_t>(context, value, &i,
&out_of_range) &&
!out_of_range) {
......@@ -512,7 +512,7 @@ gjs_value_to_g_value_internal(JSContext *context,
return throw_expect_type(context, value, "unsigned integer");
}
} else if (gtype == G_TYPE_UINT64) {
guint64 i;
uint64_t i;
if (Gjs::js_value_to_c_checked<uint64_t>(context, value, &i,
&out_of_range) &&
!out_of_range) {
......
......@@ -28,7 +28,6 @@
#include <vector>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <ffi.h>
#include <gio/gio.h>
......
......@@ -4,7 +4,6 @@
#include <config.h>
#include <ctype.h> // for toupper
#include <stdint.h>
#include <string.h> // for size_t, strlen
#include <sys/types.h> // for ssize_t
......@@ -59,7 +58,7 @@ GjsAutoChar gjs_hyphen_to_camel(const char* str) {
if (*input_iter == '-') {
uppercase_next = true;
} else if (uppercase_next) {
*output_iter++ = toupper(*input_iter);
*output_iter++ = g_ascii_toupper(*input_iter);
uppercase_next = false;
} else {
*output_iter++ = *input_iter;
......
......@@ -786,8 +786,8 @@ gjs_profiler_set_filename(GjsProfiler *self,
self->filename = g_strdup(filename);
}
void _gjs_profiler_add_mark(GjsProfiler* self, gint64 time_nsec,
gint64 duration_nsec, const char* group,
void _gjs_profiler_add_mark(GjsProfiler* self, int64_t time_nsec,
int64_t duration_nsec, const char* group,
const char* name, const char* message) {
g_return_if_fail(self);
g_return_if_fail(group);
......
......@@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: 2019 Philip Chimento <philip.chimento@gmail.com>
# SPDX-FileCopyrightText: 2019 Chun-wei Fan <fanchunwei@src.gnome.org>
project('gjs', 'cpp', 'c', version: '1.72.0', license: ['MIT', 'LGPL2+'],
project('gjs', 'cpp', 'c', version: '1.72.1', license: ['MIT', 'LGPL2+'],
meson_version: '>= 0.52.0',
default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'c_std=c99',
'warning_level=2', 'b_pch=true' ])
......
......@@ -122,6 +122,9 @@ echo "Doing: $1 $extra_opts"
do_Create_Artifacts_Folder "$1"
# Ignore extra git security checks as we don't care in CI.
git config --global --add safe.directory "${PWD}"
if test "$1" = "SETUP"; then
do_Show_Info
do_Print_Labels 'Show GJS git information'
......