Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/466361cb148e301213b8e8aa3b488bb4242827f2
...commit
http://git.netsurf-browser.org/netsurf.git/commit/466361cb148e301213b8e8aa3b488bb4242827f2
...tree
http://git.netsurf-browser.org/netsurf.git/tree/466361cb148e301213b8e8aa3b488bb4242827f2
The branch, master has been updated
via 466361cb148e301213b8e8aa3b488bb4242827f2 (commit)
from c0904cf3fbc8078d162d509083f1ec2e0bdc2b18 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=466361cb148e301213b8e8aa3b488bb4242827f2
commit 466361cb148e301213b8e8aa3b488bb4242827f2
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Amiga: Avoid double free of diskfont
diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c
index a587d6e..be1b891 100644
--- a/frontends/amiga/font_diskfont.c
+++ b/frontends/amiga/font_diskfont.c
@@ -100,7 +100,10 @@ static struct TextFont *ami_font_bm_open(struct RastPort
*rp, const plot_font_st
tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE;
NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
- if(prev_font != NULL) CloseFont(prev_font);
+ if(prev_font != NULL) {
+ CloseFont(prev_font);
+ prev_font = NULL;
+ }
if((bmfont = OpenDiskFont(&tattr))) {
SetRPAttrs(rp, RPTAG_Font, bmfont, TAG_DONE);
@@ -300,7 +303,14 @@ void ami_font_diskfont_init(void)
void ami_font_diskfont_fini(void)
{
- if(prev_font != NULL) CloseFont(prev_font);
- if(prev_fstyle != NULL) free(prev_fstyle);
+ if(prev_font != NULL) {
+ CloseFont(prev_font);
+ prev_font = NULL;
+ }
+
+ if(prev_fstyle != NULL) {
+ free(prev_fstyle);
+ prev_fstyle = NULL;
+ }
}
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/font_diskfont.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c
index a587d6e..be1b891 100644
--- a/frontends/amiga/font_diskfont.c
+++ b/frontends/amiga/font_diskfont.c
@@ -100,7 +100,10 @@ static struct TextFont *ami_font_bm_open(struct RastPort
*rp, const plot_font_st
tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE;
NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
- if(prev_font != NULL) CloseFont(prev_font);
+ if(prev_font != NULL) {
+ CloseFont(prev_font);
+ prev_font = NULL;
+ }
if((bmfont = OpenDiskFont(&tattr))) {
SetRPAttrs(rp, RPTAG_Font, bmfont, TAG_DONE);
@@ -300,7 +303,14 @@ void ami_font_diskfont_init(void)
void ami_font_diskfont_fini(void)
{
- if(prev_font != NULL) CloseFont(prev_font);
- if(prev_fstyle != NULL) free(prev_fstyle);
+ if(prev_font != NULL) {
+ CloseFont(prev_font);
+ prev_font = NULL;
+ }
+
+ if(prev_fstyle != NULL) {
+ free(prev_fstyle);
+ prev_fstyle = NULL;
+ }
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]