84 return NULL; |
84 return NULL; |
85 } |
85 } |
86 } |
86 } |
87 |
87 |
88 void cxBufferFree(CxBuffer *buffer) { |
88 void cxBufferFree(CxBuffer *buffer) { |
|
89 if (buffer == NULL) return; |
89 if ((buffer->flags & CX_BUFFER_FREE_CONTENTS) == CX_BUFFER_FREE_CONTENTS) { |
90 if ((buffer->flags & CX_BUFFER_FREE_CONTENTS) == CX_BUFFER_FREE_CONTENTS) { |
90 cxFree(buffer->allocator, buffer->bytes); |
91 cxFree(buffer->allocator, buffer->bytes); |
91 } |
92 } |
92 cxFree(buffer->allocator, buffer); |
93 cxFree(buffer->allocator, buffer); |
93 } |
94 } |