mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 20:22:15 +00:00
Win32: Plug potential memory leaks
This commit is contained in:
parent
d97e954aa3
commit
e4c4c7343c
@ -868,10 +868,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||||||
if (ctext != window->ctext) {
|
if (ctext != window->ctext) {
|
||||||
unsigned int* preeditText = _glfw_realloc(window->preeditText, sizeof(unsigned int)*ctext);
|
unsigned int* preeditText = _glfw_realloc(window->preeditText, sizeof(unsigned int)*ctext);
|
||||||
if (preeditText == NULL) {
|
if (preeditText == NULL) {
|
||||||
return 0;
|
|
||||||
_glfw_free(buffer);
|
_glfw_free(buffer);
|
||||||
_glfw_free(attributes);
|
_glfw_free(attributes);
|
||||||
_glfw_free(clauses);
|
_glfw_free(clauses);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
window->preeditText = preeditText;
|
window->preeditText = preeditText;
|
||||||
window->ctext = ctext;
|
window->ctext = ctext;
|
||||||
@ -894,10 +894,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||||||
if (cblocks != window->cblocks) {
|
if (cblocks != window->cblocks) {
|
||||||
int* blocks = _glfw_realloc(window->preeditAttributeBlocks, sizeof(int)*cblocks);
|
int* blocks = _glfw_realloc(window->preeditAttributeBlocks, sizeof(int)*cblocks);
|
||||||
if (blocks == NULL) {
|
if (blocks == NULL) {
|
||||||
return 0;
|
|
||||||
_glfw_free(buffer);
|
_glfw_free(buffer);
|
||||||
_glfw_free(attributes);
|
_glfw_free(attributes);
|
||||||
_glfw_free(clauses);
|
_glfw_free(clauses);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
window->preeditAttributeBlocks = blocks;
|
window->preeditAttributeBlocks = blocks;
|
||||||
window->cblocks = cblocks;
|
window->cblocks = cblocks;
|
||||||
|
Loading…
Reference in New Issue
Block a user