rem: BMessage* CopyMsg = NULL; if (Message) { CopyMsg = new BMessage(*Message); CopyMsg->what = B_OBSERVER_NOTICE_CHANGE; CopyMsg->AddInt32(B_OBSERVE_ORIGINAL_WHAT, Message->what); } else { CopyMsg = new BMessage(B_OBSERVER_NOTICE_CHANGE);
add: BMessage *copyMsg = NULL; if (message) { copyMsg = new BMessage(*message); copyMsg->what = B_OBSERVER_NOTICE_CHANGE; copyMsg->AddInt32(B_OBSERVE_ORIGINAL_WHAT, message->what); } else copyMsg = new BMessage(B_OBSERVER_NOTICE_CHANGE);  copyMsg->AddInt32(B_OBSERVE_WHAT_CHANGE, what);  vector<BHandler *> &handlers = fHandlerMap[what]; for (uint32 i = 0; i < handlers.size(); ++i) { BMessenger msgr(handlers[i]); msgr.SendMessage(copyMsg);
context: status_t _ObserverList::SendNotices(unsigned long what, BMessage const* Message){	// Having to new a temporary is really irritating ...	BMessage* CopyMsg = NULL;	if (Message)	{		CopyMsg = new BMessage(*Message);		CopyMsg->what = B_OBSERVER_NOTICE_CHANGE;		CopyMsg->AddInt32(B_OBSERVE_ORIGINAL_WHAT, Message->what);	}	else	{		CopyMsg = new BMessage(B_OBSERVER_NOTICE_CHANGE);	}	CopyMsg->AddInt32(B_OBSERVE_WHAT_CHANGE, what);	vector<BHandler*>& Handlers = fHandlerMap[what];	for (uint32 i = 0; i < Handlers.size(); ++i)	{		BMessenger msgr(Handlers[i]);		msgr.SendMessage(CopyMsg);	}	vector<BMessenger>& Messengers = fMessengerMap[what];	for (uint32 i = 0; i < Messengers.size(); ++i)	{		Messengers[i].SendMessage(CopyMsg);	}	// Gotta make sure to clean up the annoying temporary ...	delete CopyMsg;	return B_OK;}