Skip to content

Commit d91c316

Browse files
committed
FontInfo: Make sure that deleted member variables can no longer be used
Signed-off-by: Stefan Weil <[email protected]>
1 parent 877e62d commit d91c316

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ccstruct/fontinfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// File: fontinfo.cpp
33
// Description: Font information classes abstracted from intproto.h/cpp.
44
// Author: [email protected] (Ray Smith)
5-
// Created: Wed May 18 10:39:01 PDT 2011
65
//
76
// (C) Copyright 2011, Google Inc.
87
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -140,8 +139,10 @@ void FontInfoDeleteCallback(FontInfo f) {
140139
if (f.spacing_vec != nullptr) {
141140
f.spacing_vec->delete_data_pointers();
142141
delete f.spacing_vec;
142+
f.spacing_vec = nullptr;
143143
}
144144
delete[] f.name;
145+
f.name = nullptr;
145146
}
146147
void FontSetDeleteCallback(FontSet fs) {
147148
delete[] fs.configs;

0 commit comments

Comments
 (0)