# HG changeset patch # User Frank Benoit # Date 1200686895 -3600 # Node ID 5ac0a5d00e19512a8df7d2cfd6f806bcc0110698 # Parent 396a9fa07672cb94d3d031f113f202e96c0e854e Fix: GPollFD should be allocated via malloc diff -r 396a9fa07672 -r 5ac0a5d00e19 dwt/widgets/Display.d --- a/dwt/widgets/Display.d Fri Jan 18 20:53:49 2008 +0100 +++ b/dwt/widgets/Display.d Fri Jan 18 21:08:15 2008 +0100 @@ -3644,7 +3644,8 @@ if (getMessageCount () !is 0) return true; if (fds is null) { allocated_nfds = 2; - fds = new GPollFD[ allocated_nfds ]; + GPollFD* ptr = cast(GPollFD*) OS.g_malloc( GPollFD.sizeof * allocated_nfds ); + fds = ptr[ 0 .. allocated_nfds ]; } max_priority = timeout = 0; auto context = OS.g_main_context_default (); @@ -3656,7 +3657,8 @@ while ((nfds = OS.g_main_context_query (context, max_priority, &timeout, fds.ptr, allocated_nfds)) > allocated_nfds) { OS.g_free (fds.ptr); allocated_nfds = nfds; - fds = new GPollFD[allocated_nfds]; + GPollFD* ptr = cast(GPollFD*) OS.g_malloc( GPollFD.sizeof * allocated_nfds ); + fds = ptr[ 0 .. allocated_nfds ]; } GPollFunc poll = OS.g_main_context_get_poll_func (context); if (poll !is null) {