Skip to content

Commit

Permalink
FontInfo: Make sure that deleted member variables can no longer be used
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Feb 9, 2019
1 parent 877e62d commit d91c316
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ccstruct/fontinfo.cpp
Expand Up @@ -2,7 +2,6 @@
// File: fontinfo.cpp
// Description: Font information classes abstracted from intproto.h/cpp.
// Author: rays@google.com (Ray Smith)
// Created: Wed May 18 10:39:01 PDT 2011
//
// (C) Copyright 2011, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -140,8 +139,10 @@ void FontInfoDeleteCallback(FontInfo f) {
if (f.spacing_vec != nullptr) {
f.spacing_vec->delete_data_pointers();
delete f.spacing_vec;
f.spacing_vec = nullptr;
}
delete[] f.name;
f.name = nullptr;
}
void FontSetDeleteCallback(FontSet fs) {
delete[] fs.configs;
Expand Down

0 comments on commit d91c316

Please sign in to comment.