Bug 30810 - Wocky leaks while running unit tests
Summary: Wocky leaks while running unit tests
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Nicolas Dufresne
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/ni...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-10-12 13:25 UTC by Nicolas Dufresne
Modified: 2010-10-13 09:08 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Nicolas Dufresne 2010-10-12 13:25:35 UTC
I found that Wocky has several memory leaks that are visible while running the unit tests. As this makes it harder to check that new code does not introduce new leaks, I've fixed all the one I found. Only 1 is remaining which seems to be in GnuTLS.

Fixes are found in:
http://git.collabora.co.uk/?p=user/nicolas/wocky.git;a=shortlog;h=refs/heads/leak-fix
Comment 1 Will Thompson 2010-10-13 02:17:24 UTC
Looks good, apart from style! :)

+      if (!g_cancellable_is_cancelled (priv->cancellable))
+        {
+          g_cancellable_cancel (priv->cancellable);
+        }
+      g_object_unref (priv->cancellable);
+      priv->cancellable = NULL;

I think the if statement here should not use braces.

+  if (priv->conn)

This should check != NULL explicitly. There are loads of other cases of this in this branch.

English pedantry in a commit message for future reference: in “Most call where already implemented correctly”, you mean “were”.
Comment 2 Nicolas Dufresne 2010-10-13 08:53:48 UTC
(In reply to comment #1)
> Looks good, apart from style! :)

Sorry for that, I'm stepping from project all the time and I often loose track of right coding style.

> 
> +      if (!g_cancellable_is_cancelled (priv->cancellable))
> +        {
> +          g_cancellable_cancel (priv->cancellable);
> +        }
> +      g_object_unref (priv->cancellable);
> +      priv->cancellable = NULL;
> 
> I think the if statement here should not use braces.

Fixed.

> 
> +  if (priv->conn)
> 
> This should check != NULL explicitly. There are loads of other cases of this in
> this branch.

Ok, since it was simpler to search them all I've end up fixing 30 of them.

> 
> English pedantry in a commit message for future reference: in “Most call where
> already implemented correctly”, you mean “were”.

Fixed/Rebased


So I'll merge and push this branch soon.
Comment 3 Nicolas Dufresne 2010-10-13 09:08:37 UTC
Merged upstream.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.