From bc7e472d88ae1700efd1f9d505113afa2c19a851 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 30 Jan 2008 09:22:49 +0000 Subject: [PATCH] DragMessage() makes a copy of the passed message. We were leaking inside BTextView::_InitiateDrag(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23787 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/TextView.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 127af60c4e..bf21c47d59 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -1,11 +1,11 @@ /* - * Copyright 2001-2007, Haiku Inc. + * Copyright 2001-2008, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: * Hiroshi Lockheimer (BTextView is based on his STEEngine) * Marc Flerackers (mflerackers@androme.be) - * Stefano Ceccherini (burton666@libero.it) + * Stefano Ceccherini (stefano.ceccherini@gmail.com) */ /*! BTextView displays and manages styled text. */ @@ -3912,16 +3912,16 @@ BTextView::_TrackDrag(BPoint where) void BTextView::_InitiateDrag() { - BMessage *dragMessage = new BMessage(B_MIME_DATA); + BMessage dragMessage(B_MIME_DATA); BBitmap *dragBitmap = NULL; BPoint bitmapPoint; BHandler *dragHandler = NULL; - GetDragParameters(dragMessage, &dragBitmap, &bitmapPoint, &dragHandler); + GetDragParameters(&dragMessage, &dragBitmap, &bitmapPoint, &dragHandler); SetViewCursor(B_CURSOR_SYSTEM_DEFAULT); if (dragBitmap != NULL) - DragMessage(dragMessage, dragBitmap, bitmapPoint, dragHandler); + DragMessage(&dragMessage, dragBitmap, bitmapPoint, dragHandler); else { BRegion region; GetTextRegion(fSelStart, fSelEnd, ®ion); @@ -3930,7 +3930,7 @@ BTextView::_InitiateDrag() if (!bounds.Contains(dragRect)) dragRect = bounds & dragRect; - DragMessage(dragMessage, dragRect, dragHandler); + DragMessage(&dragMessage, dragRect, dragHandler); } BMessenger messenger(this);