Re: [PATCH 1/2] session: Only create a hashtable if apply_monitor_geometry class exists

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

 



ACK, but I'd like a couple changes to the commit log:

- in the summary: apply_monitor_geometry is a vfunc, not a class
- add a comment to the commit log explaining that this is to avoid a
memory leak when we return early.


On Wed, 2015-10-21 at 15:23 +0200, Fabiano Fidêncio wrote:
> Related: rhbz#1267184
> ---
>  src/virt-viewer-session.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
> index 2699f41..92ffd3f 100644
> --- a/src/virt-viewer-session.c
> +++ b/src/virt-viewer-session.c
> @@ -405,13 +405,15 @@
> virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession*
> self,
>      VirtViewerSessionClass *klass;
>      gboolean all_fullscreen = TRUE;
>      /* GHashTable<gint, GdkRectangle*> */
> -    GHashTable *monitors = g_hash_table_new_full(g_direct_hash,
> g_direct_equal, NULL, g_free);
> +    GHashTable *monitors;
>      GList *l;
>  
>      klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
>      if (!klass->apply_monitor_geometry)
>          return;
>  
> +    monitors = g_hash_table_new_full(g_direct_hash, g_direct_equal,
> NULL, g_free);
> +
>      for (l = self->priv->displays; l; l = l->next) {
>          VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
>          guint nth = 0;

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux