Chameleon

Chameleon Commit Details

Date:2012-05-08 20:34:40 (11 years 11 months ago)
Author:Cosmosis Jones
Commit:1949
Parents: 1948
Message:http://forge.voodooprojects.org/p/chameleon/issues/178/ apply patch to free resources on failed GUI themese
Changes:
M/trunk/i386/boot2/gui.c

File differences

trunk/i386/boot2/gui.c
202202
203203
204204
205
205206
206207
207208
......
432433
433434
434435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
435455
436456
437457
......
478498
479499
480500
501
502
503
504
505
506
507
508
509
510
511
512
513
481514
482515
483516
......
826859
827860
828861
862
863
864
865
866
867
868
869
829870
830871
831872
......
15661607
15671608
15681609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
15691625
15701626
15711627
};
int initFont(font_t *font, image_t *image);
int destroyFont(font_t *font);
void colorFont(font_t *font, uint32_t color);
void makeRoundedCorners(pixmap_t *p);
return 0;
}
static int unloadGraphics(void)
{
int i;
destroyFont(&font_console);
destroyFont(&font_small);
for (i = 0; i < sizeof(images) / sizeof(images[0]); i++)
{
if (images[i].image)
{
if (images[i].image->pixels) free(images[i].image->pixels);
free (images[i].image);
images[i].image = 0;
}
}
return 0;
}
pixmap_t *getCroppedPixmapAtPosition( pixmap_t *from, position_t pos, uint16_t width, uint16_t height )
{
return 0;
}
int freeBackBuffer( window_t *window )
{
if (gui.backbuffer && gui.backbuffer->pixels)
{
free(gui.backbuffer->pixels);
free(gui.backbuffer);
gui.backbuffer = 0;
return 0;
}
return 1;
}
int createWindowBuffer( window_t *window )
{
window->pixmap = malloc(sizeof(pixmap_t));
}
}
}
// not available memory, freeing resources
freeWindowBuffer(&gui.menu);
freeWindowBuffer(&gui.infobox);
freeWindowBuffer(&gui.bootprompt);
freeWindowBuffer(&gui.devicelist);
freeWindowBuffer(&gui.screen);
freeBackBuffer(&gui.screen);
unloadGraphics();
return 1;
}
return 0;
}
int destroyFont(font_t *font)
{
int i;
for (i = 0; i < CHARACTERS_COUNT; i++)
{
if (font->chars[i])
{
if (font->chars[i]->pixels) free (font->chars[i]->pixels);
free (font->chars[i]);
font->chars[i] = 0;
}
}
return 0;
}
void colorFont(font_t *font, uint32_t color)
{
if( !color )

Archive Download the corresponding diff file

Revision: 1949