[Live-devel] May createNewSomething methods return NULL?

Ross Finlayson finlayson at live555.com
Wed Sep 7 10:12:58 PDT 2016


It depends.  Most of the “createNew()” functions just do
	return new SomeConstructor();
Should that fail, then things are TARFU anyway (see https://en.wikipedia.org/wiki/List_of_military_slang_terms#TARFU :-)

In a few cases, however, the “createNew()” function takes some extra parameter(s).  If these parameter(s) are invalid, then the “createNew()” function returns NULL.  An example of this is "ByteStreamFileSource::createNew()”, which takes an extra ‘fileName’ parameter.  If that file does not exist (or could not be opened for reading), then “createNew()” returns NULL.


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




More information about the live-devel mailing list