Ignore:
Timestamp:
Oct 13, 2008, 4:44:35 AM (17 years ago)
Author:
[email protected]
Message:

2008-10-13 Marco Barisione <[email protected]>

Reviewed by Darin Adler. Landed by Jan Alonzo.

WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
http://bugs.webkit.org/show_bug.cgi?id=20483

Start the conversion to use GOwnPtr and fix a memory leak.

  • platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: (WebCore::mediaPlayerPrivateErrorCallback):

2008-10-13 Marco Barisione <[email protected]>

Reviewed by Darin Adler. Landed by Jan Alonzo.

WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
http://bugs.webkit.org/show_bug.cgi?id=20483

Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
allocated by GLib and start the conversion to use it.

  • GNUmakefile.am:
  • wtf/GOwnPtr.cpp: Added. (WTF::GError): (WTF::GList): (WTF::GCond): (WTF::GMutex): (WTF::GPatternSpec): (WTF::GDir):
  • wtf/GOwnPtr.h: Added. (WTF::freeOwnedPtr): (WTF::GOwnPtr::GOwnPtr): (WTF::GOwnPtr::~GOwnPtr): (WTF::GOwnPtr::get): (WTF::GOwnPtr::release): (WTF::GOwnPtr::rawPtr): (WTF::GOwnPtr::set): (WTF::GOwnPtr::clear): (WTF::GOwnPtr::operator*): (WTF::GOwnPtr::operator->): (WTF::GOwnPtr::operator!): (WTF::GOwnPtr::operator UnspecifiedBoolType): (WTF::GOwnPtr::swap): (WTF::swap): (WTF::operator==): (WTF::operator!=): (WTF::getPtr):
  • wtf/Threading.h:
  • wtf/ThreadingGtk.cpp: (WTF::Mutex::~Mutex): (WTF::Mutex::lock): (WTF::Mutex::tryLock): (WTF::Mutex::unlock): (WTF::ThreadCondition::~ThreadCondition): (WTF::ThreadCondition::wait): (WTF::ThreadCondition::timedWait): (WTF::ThreadCondition::signal): (WTF::ThreadCondition::broadcast):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Threading.h

    r37409 r37556  
    6363#include <wtf/Locker.h>
    6464#include <wtf/Noncopyable.h>
     65#if PLATFORM(GTK)
     66#include <wtf/GOwnPtr.h>
     67#endif
    6568
    6669#if PLATFORM(WIN_OS)
     
    118121typedef pthread_cond_t PlatformCondition;
    119122#elif PLATFORM(GTK)
    120 typedef GMutex* PlatformMutex;
    121 typedef GCond* PlatformCondition;
     123typedef GOwnPtr<GMutex> PlatformMutex;
     124typedef GOwnPtr<GCond> PlatformCondition;
    122125#elif PLATFORM(QT)
    123126typedef QT_PREPEND_NAMESPACE(QMutex)* PlatformMutex;
Note: See TracChangeset for help on using the changeset viewer.