23 Aug 17:32
Re: Bug in UpsateScaled() ?
How are you creating the AG_Pixmap widget? AG_PixmapFromSurface() will only map the surface argument without duplicating it, so the surface must remain valid for the lifetime of the widget. AG_PixmapFromSurfaceCopy(), however, will implicitely duplicate the surface for you. To be consistent with what most other widgets use for functions accepting surface arguments, I should really rename them: AG_PixmapFromSurfaceCopy() -> AG_PixmapFromSurface() AG_PixmapFromSurface() -> AG_PixmapFromSurfaceNODUP() but unfortunately I can't do that without breaking compatibility. On Mon, Aug 23, 2010 at 11:12:22AM +0000, A. Steinhoff wrote: > > Hi, > > I have a single window SDL app with three agar windows. > When I close the first one and in one of the remaining windows from tab to tab > .... the application craches. Below is the backtrace of ddd: > > #0 0xb7ec687e in AG_PixelFormatDup (pf=0x69) at surface.c:181 > #1 0xb7ec6a98 in AG_SurfaceNew (type=AG_SURFACE_PACKED, w=100, h=105, pf=0x69, > flags=2) at surface.c:241 > #2 0xb7ec88aa in AG_ScaleSurface (ss=0x80d4c88, w=100, h=105, ds=0xb668a0bc) at > surface.c:790 > #3 0xb7ea2138 in UpdateScaled (px=0x815bdc8) at pixmap.c:334 > #4 0xb7ea2215 in Draw (obj=0x815bdc8) at pixmap.c:361 > #5 0xb7e58713 in AG_WidgetDraw (p=0x815bdc8) at widget.c:887 > #6 0xb7e6f436 in Draw (obj=0x814c5d0) at box.c:155 > #7 0xb7e59854 in AG_WidgetInheritDraw (obj=0x814c5d0) at widget.c:1250 > #8 0xb7e58713 in AG_WidgetDraw (p=0x814c5d0) at widget.c:887 > #9 0xb7ea0977 in Draw (obj=0x814aca0) at notebook.c:143 > #10 0xb7e58713 in AG_WidgetDraw (p=0x814aca0) at widget.c:887 > #11 0xb7e5ac4b in Draw (obj=0x811e7e0) at window.c:473 > #12 0xb7e58713 in AG_WidgetDraw (p=0x811e7e0) at widget.c:887 > #13 0xb7ed0444 in SDLFB_RenderWindow (win=0x811e7e0) at drv_sdlfb.c:181 > #14 0xb7f3b810 in AG_WindowDraw (win=0x811e7e0) at > /usr/include/agar/agar/gui/window.h:184 > #15 0xb7f3b688 in AG_Render () at /home/DACHS/dView/fb_lib/ArGLLIB/agcore02.c:136 > > Cheers > > --Armin > > > _______________________________________________ > Agar mailing list > Agar@... > http://libagar.org/lists.html
RSS Feed