MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / osvrClientFreeInterface

Function osvrClientFreeInterface

src/osvr/ClientKit/InterfaceC.cpp:53–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53OSVR_ReturnCode osvrClientFreeInterface(OSVR_ClientContext ctx,
54 OSVR_ClientInterface iface) {
55 if (nullptr == ctx) {
56 /// Return failure if given a null context
57 return OSVR_RETURN_FAILURE;
58 }
59 if (nullptr == iface) {
60 /// Return failure if given a null interface
61 return OSVR_RETURN_FAILURE;
62 }
63
64 /// This call returns a smart pointer - going to let it go out of scope
65 /// here to delete.
66 osvr::common::ClientInterfacePtr ptr(ctx->releaseInterface(iface));
67 if (!ptr) {
68 /// Return failure if the context didn't have a record of this
69 /// interface.
70 return OSVR_RETURN_FAILURE;
71 }
72 return OSVR_RETURN_SUCCESS;
73}

Callers 1

freeMethod · 0.85

Calls 1

releaseInterfaceMethod · 0.45

Tested by

no test coverage detected