victorprad/InfiniTAM — pull request #5 by sgolodetz (2014-10-31 22:15:51+00:00)
Title: Make the OpenNIEngine constructor throw on fatal errors, and remove a redundant condition.

Shutting down OpenNI means that OpenNIEngine construction has irretrievably failed. The standard way of handling failures in constructors is to throw (aborting construction of the object) rather than returning (which leaves the object in a partially-constructed and failed state). Partially-constructed objects can be dangerous if people use them as if they were fully-constructed ones. To avoid problems, it's much safer just to never partially construct objects in the first place.

See also: http://www.gotw.ca/publications/mill13.htm