bakery r111 - in trunk: . bakery/Document



Author: murrayc
Date: Fri Mar 28 16:34:55 2008
New Revision: 111
URL: http://svn.gnome.org/viewvc/bakery?rev=111&view=rev

Log:
2008-03-28  Murray Cumming  <murrayc murrayc com>

* bakery/Document/Document.cc: write_to_disk(): A better workaround 
for the giomm ref leak (now fixed in glibmm anyway).

Modified:
   trunk/ChangeLog
   trunk/bakery/Document/Document.cc

Modified: trunk/bakery/Document/Document.cc
==============================================================================
--- trunk/bakery/Document/Document.cc	(original)
+++ trunk/bakery/Document/Document.cc	Fri Mar 28 16:34:55 2008
@@ -272,10 +272,7 @@
     {
       if(file->query_exists())
       {
-        //stream = file->replace(); //Instead of append_to().
-        std::string etag_out;
-        file->replace_contents(m_strContents, std::string(), etag_out); //TODO: This is a workaround for http://bugzilla.gnome.org/show_bug.cgi?id=524686
-        return true;
+        stream = file->replace(); //Instead of append_to().
       }
       else
       {
@@ -307,6 +304,11 @@
     {
       //Write the data to the output uri
       const gsize bytes_written = stream->write(m_strContents.data(), m_strContents.bytes());
+
+      //Close the stream to make sure that the write really happens 
+      //even with glibmm 2.16.0 which had a refcount leak that stopped it.
+      stream->close();
+      stream.reset();
     }
     catch(const Gio::Error& ex)
     {



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