Free encoded frames after sending them

tight-png
Andri Yngvason 2019-09-06 19:26:18 +00:00 committed by Andri Yngvason
parent 85c6ce0729
commit 6660df4d8d
1 changed files with 7 additions and 1 deletions

View File

@ -747,6 +747,12 @@ void nvnc_close(struct nvnc *self)
free(self); free(self);
} }
static void free_write_buffer(uv_write_t *req, int status)
{
struct vnc_write_request *rq = (struct vnc_write_request*)req;
free(rq->buffer.base);
}
EXPORT EXPORT
int nvnc_update_fb(struct nvnc *self, const struct nvnc_fb *fb, int nvnc_update_fb(struct nvnc *self, const struct nvnc_fb *fb,
const struct pixman_region16 *input_region) const struct pixman_region16 *input_region)
@ -786,7 +792,7 @@ int nvnc_update_fb(struct nvnc *self, const struct nvnc_fb *fb,
pixman_region_clear(cregion); pixman_region_clear(cregion);
vnc__write((uv_stream_t*)&client->stream_handle, frame.data, vnc__write((uv_stream_t*)&client->stream_handle, frame.data,
frame.len, NULL); frame.len, free_write_buffer);
} }
rc = 0; rc = 0;