Fix clipboard target properties and memory leak
This commit is contained in:
parent
ae8f3de070
commit
15e4be9051
4
glfw/x11_window.c
vendored
4
glfw/x11_window.c
vendored
@ -793,7 +793,7 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
|
|||||||
32,
|
32,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char*) targets,
|
(unsigned char*) targets,
|
||||||
sizeof(targets[0]) * (aa->sz + 2));
|
aa->sz + 2);
|
||||||
free(targets);
|
free(targets);
|
||||||
return request->property;
|
return request->property;
|
||||||
}
|
}
|
||||||
@ -2881,7 +2881,7 @@ void _glfwPlatformSetClipboard(GLFWClipboardType t) {
|
|||||||
}
|
}
|
||||||
if (aa->capacity < cd->num_mime_types + 32) {
|
if (aa->capacity < cd->num_mime_types + 32) {
|
||||||
aa->capacity = cd->num_mime_types + 32;
|
aa->capacity = cd->num_mime_types + 32;
|
||||||
aa->array = malloc(sizeof(aa->array[0]) * aa->capacity);
|
aa->array = reallocarray(aa->array, aa->capacity, sizeof(aa->array[0]));
|
||||||
}
|
}
|
||||||
aa->sz = 0;
|
aa->sz = 0;
|
||||||
for (size_t i = 0; i < cd->num_mime_types; i++) {
|
for (size_t i = 0; i < cd->num_mime_types; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user