summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-13 00:04:43 -0400
committerPietro Gagliardi <[email protected]>2015-04-13 00:04:43 -0400
commit07944e8c1db30179b5b7aa876087648ff4587700 (patch)
tree3047e6e8f981a2723c47ddd1e8713ee924289db6
parent2b412296f1a3d8cb6dd5ccea7632ec18d0b83d0f (diff)
Fixed a small undefined-behavior bug in the parent code. Still not working...
-rw-r--r--new/parent_windows.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/new/parent_windows.c b/new/parent_windows.c
index 55957e5..baf5e54 100644
--- a/new/parent_windows.c
+++ b/new/parent_windows.c
@@ -243,7 +243,8 @@ uiParent *uiNewParent(uintptr_t osParent)
struct parent *pp;
p = uiNew(uiParent);
- pp = uiNew(struct parent);
+ p->Internal = uiNew(struct parent); // set now in case the parent class window procedure uses it
+ pp = (struct parent *) (p->Internal);
pp->hwnd = CreateWindowExW(0,
uiParentClass, L"",
WS_CHILD | WS_VISIBLE,
@@ -252,7 +253,6 @@ uiParent *uiNewParent(uintptr_t osParent)
(HWND) osParent, NULL, hInstance, p);
if (pp->hwnd == NULL)
logLastError("error creating uiParent window in uiNewParent()");
- p->Internal = pp;
p->Handle = parentHandle;
p->SetChild = parentSetChild;
p->SetMargins = parentSetMargins;