| 51 | } |
| 52 | |
| 53 | OSVR_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 | } |