Bug 60165

Summary: [GTK] Unref the SoupSession used by WebKitGtk+ at exit
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: New BugsAssignee: Sergio Villar Senin <svillar>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, mrobinson, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch mrobinson: review+

Description Sergio Villar Senin 2011-05-04 06:28:18 PDT
[GTK] Unref the SoupSession used by WebKitGtk+ at exit
Comment 1 Sergio Villar Senin 2011-05-04 06:31:23 PDT
Created attachment 92229 [details]
Patch
Comment 2 Martin Robinson 2011-05-04 08:29:42 PDT
Comment on attachment 92229 [details]
Patch

Have you looked at using DEFINE_STATIC_LOCAL and a GRefPtr to do this?
Comment 3 Sergio Villar Senin 2011-05-05 10:57:11 PDT
(In reply to comment #2)
> (From update of attachment 92229 [details])
> Have you looked at using DEFINE_STATIC_LOCAL and a GRefPtr to do this?

I understood that DEFINE_STATIC_LOCAL was used to avoid destructor calling on exit which is totally the contrary to what I'm trying to achieve. Maybe I'm not understanding what you mean...
Comment 4 Martin Robinson 2011-05-05 12:35:24 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 92229 [details] [details])
> > Have you looked at using DEFINE_STATIC_LOCAL and a GRefPtr to do this?
> 
> I understood that DEFINE_STATIC_LOCAL was used to avoid destructor calling on exit which is totally the contrary to what I'm trying to achieve. Maybe I'm not understanding what you mean...

It's used to avoid false leaks reporting on exit.
Comment 5 Xan Lopez 2011-06-02 09:00:58 PDT
(In reply to comment #4)
> It's used to avoid false leaks reporting on exit.

From the macro documentation:

// Use these to declare and define a static local variable (static T;) so that
//  it is leaked so that its destructors are not called at exit. Using this
//  macro also allows workarounds a compiler bug present in Apple's version of GCC 4.0.1.

So it seems to me it does the opposite of what we want?
Comment 6 Martin Robinson 2011-06-02 09:09:41 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > It's used to avoid false leaks reporting on exit.
> 
> From the macro documentation:
> 
> // Use these to declare and define a static local variable (static T;) so that
> //  it is leaked so that its destructors are not called at exit. Using this
> //  macro also allows workarounds a compiler bug present in Apple's version of GCC 4.0.1.
> 
> So it seems to me it does the opposite of what we want?

Oh right. It seems so!
Comment 7 Sergio Villar Senin 2011-06-03 03:05:37 PDT
Committed r87999: <http://trac.webkit.org/changeset/87999>