From 1a1a4f955ca0bb7c8af0e8e8702dfaac078c6ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 24 Oct 2008 21:29:35 +0000 Subject: [PATCH] * Updated the license header. * Use new(nothrow) to allocate the MethodReplicant. * fSignature needs to be free()d, not deleted. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28318 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/MethodReplicant.cpp | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/servers/input/MethodReplicant.cpp b/src/servers/input/MethodReplicant.cpp index d355db7c1d..b30aba4c2d 100644 --- a/src/servers/input/MethodReplicant.cpp +++ b/src/servers/input/MethodReplicant.cpp @@ -1,18 +1,15 @@ -// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -// -// Copyright (c) 2004, Haiku -// -// This software is part of the Haiku distribution and is covered -// by the Haiku license. -// -// -// File: MethodReplicant.cpp -// Authors: Jérôme Duval, -// -// Description: Input Server -// Created: October 13, 2004 -// -// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +/* + * Copyright (c) 2004-2008, Haiku. All rights reserved. + * Distributed under the terms of the MIT/X11 license. + * + * Authors: + * Jérôme Duval + */ + +#include "MethodReplicant.h" + +#include +#include #include #include @@ -24,8 +21,6 @@ #include #include -#include -#include "MethodReplicant.h" #include "remote_icon.h" #include "InputServerTypes.h" @@ -84,7 +79,7 @@ MethodReplicant::MethodReplicant(BMessage *message) MethodReplicant::~MethodReplicant() { delete fSegments; - delete fSignature; + free(fSignature); } @@ -95,7 +90,7 @@ MethodReplicant::Instantiate(BMessage *data) CALLED(); if (!validate_instantiation(data, REPLICANT_CTL_NAME)) return NULL; - return new MethodReplicant(data); + return new(std::nothrow) MethodReplicant(data); }