]> git.pld-linux.org Git - packages/crossfire-client.git/blob - crossfire-client-memleak.patch
- updated to 1.8.0 (images to 1.7.1)
[packages/crossfire-client.git] / crossfire-client-memleak.patch
1 diff -u -r1.48 -r1.50
2 --- gtk/gx11.c  4 Apr 2004 10:07:47 -0000       1.48
3 +++ gtk/gx11.c  16 May 2004 06:09:21 -0000      1.50
4 @@ -677,15 +677,39 @@
5  
6  
7  /* Event handlers for map drawing area */
8 -
9 +/* For a reason I don't know, this gets called a whole bunch.
10 + * every time a monster is killed, this gets called for a reason
11 + * I can't figure out.
12 + */
13  
14  static gint
15  configure_event (GtkWidget *widget, GdkEventConfigure *event)
16  {
17 +    static sint16  ox=-1, oy=-1;
18 +
19 +    /* Handle the surplus number of events that this causes to be generated.
20 +     * basically, if the size of the window hasn't changed, we really don't
21 +     * care - position of the window isn't important.
22 +     * note that we could be more clever and free up the other data even on
23 +     * requests that do change the size,
24 +     * but this will fix the most horrendous memory leak
25 +     */
26 +    if (event->type == GDK_CONFIGURE) {
27 +       if (((GdkEventConfigure*)event)->width == ox && ((GdkEventConfigure*)event)->height == oy)
28 +           return TRUE;
29 +       else {
30 +#if 0
31 +           fprintf(stderr, "ox=%d != %d, oy=%d != %d\n", ox, ((GdkEventConfigure*)event)->width,
32 +                   oy, ((GdkEventConfigure*)event)->height);
33 +#endif
34 +           ox = ((GdkEventConfigure*)event)->width;
35 +           oy = ((GdkEventConfigure*)event)->height;
36 +       }
37 +    }
38  
39  #ifdef HAVE_SDL
40      if(use_config[CONFIG_SDL]) {
41 -       /* When program first runs, mapsruface can be null.
42 +       /* When program first runs, mapsurface can be null.
43          * either way, we want to catch it here.
44          */
45         if (mapsurface)
This page took 0.053395 seconds and 3 git commands to generate.