mail[Wesnoth-commits] r28979 - in /trunk/src: text.cpp text.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 25, 2008 - 19:46:
Author: mordante
Date: Mon Aug 25 19:39:05 2008
New Revision: 28979

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28979&view=rev
Log:
Use the default PangoFontMap.

This speeds up the creation of a text object and also seems to fix the
rather nasty memory leak we had.

Modified:
    trunk/src/text.cpp
    trunk/src/text.hpp

Modified: trunk/src/text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/text.cpp?rev=28979&r1=28978&r2=28979&view=diff
==============================================================================
--- trunk/src/text.cpp (original)
+++ trunk/src/text.cpp Mon Aug 25 19:39:05 2008
@@ -33,8 +33,8 @@
 const unsigned ttext::STYLE_UNDERLINE = TTF_STYLE_UNDERLINE;
 
 ttext::ttext() :
-       
font_map_(reinterpret_cast<PangoCairoFontMap*>(pango_cairo_font_map_new())),
-       context_(pango_cairo_font_map_create_context(font_map_)),
+       context_(pango_cairo_font_map_create_context((
+               
reinterpret_cast<PangoCairoFontMap*>(pango_cairo_font_map_get_default())))),
        layout_(pango_layout_new(context_)),
        rect_(),
        surface_(),
@@ -58,9 +58,6 @@
 
 ttext::~ttext()
 {
-       if(font_map_) {
-               g_object_unref(font_map_);
-       }
        if(context_) {
                g_object_unref(context_);
        }

Modified: trunk/src/text.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/text.hpp?rev=28979&r1=28978&r2=28979&view=diff
==============================================================================
--- trunk/src/text.hpp (original)
+++ trunk/src/text.hpp Mon Aug 25 19:39:05 2008
@@ -96,7 +96,6 @@
 private:
 
        /***** ***** ***** *****  Pango variables ***** ***** ***** *****/
-       PangoCairoFontMap* font_map_;
        PangoContext* context_;
        PangoLayout* layout_;
        PangoRectangle rect_;




Related Messages


Powered by MHonArc, Updated Mon Aug 25 20:02:25 2008