Commit a78ad731 authored by Daniel Elstner's avatar Daniel Elstner
Browse files

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.
parent 8ba28d87
......@@ -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_;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment