[Fix] Attempting to kill some seg faults.

This commit is contained in:
Allanis 2013-04-03 17:24:06 +01:00
parent d9c0459f4b
commit 1ef8cbfe44
2 changed files with 4 additions and 3 deletions

View File

@ -72,7 +72,7 @@ void hook_rm(int id) {
if(m == (hook_nstack-1)) return; if(m == (hook_nstack-1)) return;
// Move it! // Move it!
memmove(&hook_stack[m+1], &hook_stack[m+2], hook_nstack-(m+1)); memmove(&hook_stack[m+1], &hook_stack[m+2], sizeof(Hook)*(hook_nstack-(m+2)));
hook_nstack--; hook_nstack--;
} }

View File

@ -573,9 +573,10 @@ void window_destroyWidget(unsigned int wid, const char* wgtname) {
widget_cleanup(&w->widgets[i]); widget_cleanup(&w->widgets[i]);
if(i < w->nwidgets-1) if(i < w->nwidgets-1)
// This isn't the last widget. // This isn't the last widget.
w->widgets[i] = w->widgets[i-1]; memmove(&w->widgets[i], &w->widgets[i+1],
sizeof(Widget) * (w->nwidgets-i-1));
w->nwidgets--; // Not that we don't actually realloc the space.. (w->nwidgets)--; // Not that we don't actually realloc the space..
} }
static void toolkit_drawOutline(double x, double y, double w, double h, static void toolkit_drawOutline(double x, double y, double w, double h,