Proposal for change in standard anti-crash C++ checks

Kent James kent at caspia.com
Tue Nov 5 23:55:17 UTC 2013


I'd like to have a small discussion about standard ways of checking for 
errors in C++ code as anti-crash prevention.

A common pattern is code is the following (taken from 
nsMsgDBFolder::GetMsgStore which is fairly recent code):

   nsCOMPtr<nsIMsgIncomingServer> server;  nsresult rv = GetServer(getter_AddRefs(server));

   NS_ENSURE_SUCCESS(rv, NS_MSG_INVALID_OR_MISSING_SERVER);

   return server->GetMsgStore(aStore);






More information about the tb-planning mailing list