[regexxer] Fix build with recent glibmm releases
- From: Daniel Elstner <daniel src gnome org>
- To: svn-commits-list gnome org
- Subject: [regexxer] Fix build with recent glibmm releases
- Date: Wed, 24 Jun 2009 18:22:53 +0000 (UTC)
commit a78ad731fd79f646f1e0ffa7fbf370bbff5c76ac
Author: Daniel Elstner <danielk openismus com>
Date: Wed Jun 24 20:09:58 2009 +0200
Fix build with recent glibmm releases
* src/filebuffer.cc (FileBuffer::on_mark_deleted): Use swap() to
reset Glib::RefPtr<> because neither clear() nor reset() can be
relied upon to be there.
* src/filetree.cc (FileTree::save_file_at_iter): ditto,
(FileTree::find_matches_at_path_iter): ditto,
(FileTree::on_selection_changed): ditto.
src/filebuffer.cc | 4 ++--
src/filetree.cc | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/filebuffer.cc b/src/filebuffer.cc
index 5699ca7..2f4642e 100644
--- a/src/filebuffer.cc
+++ b/src/filebuffer.cc
@@ -679,7 +679,7 @@ void FileBuffer::on_mark_deleted(const Glib::RefPtr<FileBuffer::Mark>& mark)
{
const MatchSet::iterator pos = current_match_++;
- (*pos)->mark.clear();
+ Glib::RefPtr<FileBuffer::Mark>().swap((*pos)->mark);
match_set_.erase(pos);
match_removed_ = true;
@@ -693,7 +693,7 @@ void FileBuffer::on_mark_deleted(const Glib::RefPtr<FileBuffer::Mark>& mark)
if (pos != match_set_.end())
{
- (*pos)->mark.clear();
+ Glib::RefPtr<FileBuffer::Mark>().swap((*pos)->mark);
match_set_.erase(pos);
--match_count_;
diff --git a/src/filetree.cc b/src/filetree.cc
index c0b2cbe..3fc2398 100644
--- a/src/filetree.cc
+++ b/src/filetree.cc
@@ -536,7 +536,7 @@ bool FileTree::save_file_at_iter(const Gtk::TreeModel::iterator& iter,
propagate_modified_change(iter, false);
if (fileinfo != last_selected_ && fileinfo->buffer->is_freeable())
- fileinfo->buffer.clear(); // reduce memory footprint
+ Glib::RefPtr<FileBuffer>().swap(fileinfo->buffer); // reduce memory footprint
}
return false;
@@ -588,7 +588,7 @@ bool FileTree::find_matches_at_path_iter(const Gtk::TreeModel::Path& path,
propagate_match_count_change(iter, new_match_count - old_match_count);
if (fileinfo != last_selected_ && buffer->is_freeable())
- fileinfo->buffer.clear(); // reduce memory footprint
+ Glib::RefPtr<FileBuffer>().swap(fileinfo->buffer); // reduce memory footprint
}
return false;
@@ -736,7 +736,7 @@ void FileTree::on_selection_changed()
if (last_selected_ && last_selected_ != fileinfo &&
last_selected_->buffer && last_selected_->buffer->is_freeable())
{
- last_selected_->buffer.clear(); // reduce memory footprint
+ Glib::RefPtr<FileBuffer>().swap(last_selected_->buffer); // reduce memory footprint
}
last_selected_ = fileinfo;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]