| 883 | } |
| 884 | |
| 885 | TSReturnCode |
| 886 | TSMBufferDestroy(TSMBuffer bufp) |
| 887 | { |
| 888 | // Allow to modify the buffer only |
| 889 | // if bufp is modifiable. If bufp is not modifiable return |
| 890 | // TS_ERROR. If allowed, return TS_SUCCESS. Changed the |
| 891 | // return value of function from void to TSReturnCode. |
| 892 | if (!isWriteable(bufp)) { |
| 893 | return TS_ERROR; |
| 894 | } |
| 895 | |
| 896 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 897 | HdrHeapSDKHandle *sdk_heap = reinterpret_cast<HdrHeapSDKHandle *>(bufp); |
| 898 | sdk_heap->m_heap->destroy(); |
| 899 | delete sdk_heap; |
| 900 | return TS_SUCCESS; |
| 901 | } |
| 902 | |
| 903 | //////////////////////////////////////////////////////////////////// |
| 904 | // |