From b2f1b918ed8e9264ab9a9c7a52d002c2af69e6ab Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 28 Dec 2010 13:05:23 +0000 Subject: [PATCH] empty the message before reusing it, otherwise the pictures will be archived multiple times. Should fix ticket #7035. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39981 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PictureButton.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/PictureButton.cpp b/src/kits/interface/PictureButton.cpp index dca02529ac..8a93eddfeb 100644 --- a/src/kits/interface/PictureButton.cpp +++ b/src/kits/interface/PictureButton.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009, Haiku, Inc. + * Copyright 2001-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: @@ -88,25 +88,27 @@ BPictureButton::Archive(BMessage* data, bool deep) const // Fill out message, depending on whether a deep copy is required or not. if (deep) { BMessage pictureArchive; - if (fEnabledOn->Archive(&pictureArchive, deep) == B_OK) { err = data->AddMessage("_e_on", &pictureArchive); if (err != B_OK) return err; } + pictureArchive.MakeEmpty(); if (fEnabledOff->Archive(&pictureArchive, deep) == B_OK) { err = data->AddMessage("_e_off", &pictureArchive); if (err != B_OK) return err; } + pictureArchive.MakeEmpty(); if (fDisabledOn && fDisabledOn->Archive(&pictureArchive, deep) == B_OK) { err = data->AddMessage("_d_on", &pictureArchive); if (err != B_OK) return err; } + pictureArchive.MakeEmpty(); if (fDisabledOff && fDisabledOff->Archive(&pictureArchive, deep) == B_OK) { err = data->AddMessage("_d_off", &pictureArchive); if (err != B_OK)