QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Konstantin Kostiuk <konstantin@daynix.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	QEMU <qemu-devel@nongnu.org>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [PATCH] qga-win: Free GMatchInfo properly
Date: Thu, 10 Jun 2021 18:59:12 +0300	[thread overview]
Message-ID: <CAJ28CFS7btno-t-rpP_Q98uwWCAdDnX2os41RYjdickcgaWVBQ@mail.gmail.com> (raw)
In-Reply-To: <YMIuWtE9VjZDUQYz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

Thanks, Daniel!

A new patch was sent.

Best wishes,
Kostiantyn Kostiuk


On Thu, Jun 10, 2021 at 6:23 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Thu, Jun 10, 2021 at 05:53:35PM +0300, Konstantin Kostiuk wrote:
> > Hi All,
> >
> > For freeing GMatchInfo struct, a special function is required. I'm not
> sure is
> > it possible to use g_autoptr in this case or no.
> > In GLib example
> >
> https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-regex-match
> ,
> > g_match_info_free is used directly.
>
> That is fine - g_autoptr calls the required deallocation function
> that was previously registered. This is different from g_autofree
> which merely calls g_free.
>
> We can see GMatchInfo is configured to call g_match_info_free:
>
> $ grep GMatchIn /usr/include/glib-2.0/glib/*.h
> /usr/include/glib-2.0/glib/glib-autocleanups.h:G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo,
> g_match_info_unref)
>
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>

[-- Attachment #2: Type: text/html, Size: 2434 bytes --]

      reply	other threads:[~2021-06-10 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 14:38 [PATCH] qga-win: Free GMatchInfo properly Kostiantyn Kostiuk
2021-06-10 14:41 ` Marc-André Lureau
2021-06-10 14:53   ` Konstantin Kostiuk
2021-06-10 15:23     ` Daniel P. Berrangé
2021-06-10 15:59       ` Konstantin Kostiuk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ28CFS7btno-t-rpP_Q98uwWCAdDnX2os41RYjdickcgaWVBQ@mail.gmail.com \
    --to=konstantin@daynix.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).