Permalink
Browse files

Cleaned up InvokeMethod

  • Loading branch information...
1 parent dce689c commit 0a42cabb581a840fbed1c1a3b28a0f0a721685c8 @rwmtse rwmtse committed May 7, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 ext/blackberry.connection/native/connection_js.cpp
@@ -50,17 +50,16 @@ std::string Connection::InvokeMethod(const std::string& command)
string strCommand = command.substr(0, index);
string jsonObject = command.substr(index + 1, command.length());
- string returnValue;
if (strCommand == "getType") {
ConnectionBPS *connection = new ConnectionBPS();
std::stringstream ss;
ss << connection->GetConnectionType();
- returnValue.assign(ss.str());
delete connection;
+ return ss.str();
}
- return returnValue;
+ return NULL;
}
bool Connection::CanDelete()

0 comments on commit 0a42cab

Please sign in to comment.