> And one more question, in the samples and the library itself many places in 
> the
> code looks like this:
> 
>  RTSPClient* rtspClient = ourRTSPClient::createNew(env, rtspURL,
> RTSP_CLIENT_VERBOSITY_LEVEL, progName);
> 
>  if (rtspClient == NULL) {
> 
> createNew() just a wrapper over the standard operator new (not overloaded, 
> not a
> `nothrow` version). But according the c++ standard operator new is never 
> return
> NULL, but throws bad_alloc on error. Why we need to check the return value? 

Yes, you're correct - in this case, the test for "rtspClient == NULL" is not 
needed, and could be removed.

Note, however, that not all "createNew()" functions are simply wrappers around 
operator new.  "RTSPServer::createNew()", for example, is not.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to