提交 1d6dd03b 编写于 作者: S Stefan Weil

training: Replace memfree by free

free also accepts a nullptr argument, so the code can be simplified.
Signed-off-by: NStefan Weil <sw@weilnetz.de>
上级 ca89a11f
......@@ -22,7 +22,6 @@
#include "emalloc.h"
#include "featdefs.h"
#include "fontinfo.h"
#include "freelist.h"
#include "globals.h"
#include "intfeaturespace.h"
#include "mastertrainer.h"
......@@ -579,18 +578,12 @@ void CleanUpUnusedData(
iterate(ProtoList)
{
Prototype = (PROTOTYPE *) first_node (ProtoList);
if (Prototype->Variance.Elliptical != nullptr) {
memfree(Prototype->Variance.Elliptical);
Prototype->Variance.Elliptical = nullptr;
}
if (Prototype->Magnitude.Elliptical != nullptr) {
memfree(Prototype->Magnitude.Elliptical);
Prototype->Magnitude.Elliptical = nullptr;
}
if (Prototype->Weight.Elliptical != nullptr) {
memfree(Prototype->Weight.Elliptical);
Prototype->Weight.Elliptical = nullptr;
}
free(Prototype->Variance.Elliptical);
Prototype->Variance.Elliptical = nullptr;
free(Prototype->Magnitude.Elliptical);
Prototype->Magnitude.Elliptical = nullptr;
free(Prototype->Weight.Elliptical);
Prototype->Weight.Elliptical = nullptr;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册