mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
training: Replace memfree by free
free also accepts a nullptr argument, so the code can be simplified. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
ca89a11f28
commit
1d6dd03bfc
@ -22,7 +22,6 @@
|
|||||||
#include "emalloc.h"
|
#include "emalloc.h"
|
||||||
#include "featdefs.h"
|
#include "featdefs.h"
|
||||||
#include "fontinfo.h"
|
#include "fontinfo.h"
|
||||||
#include "freelist.h"
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "intfeaturespace.h"
|
#include "intfeaturespace.h"
|
||||||
#include "mastertrainer.h"
|
#include "mastertrainer.h"
|
||||||
@ -579,18 +578,12 @@ void CleanUpUnusedData(
|
|||||||
iterate(ProtoList)
|
iterate(ProtoList)
|
||||||
{
|
{
|
||||||
Prototype = (PROTOTYPE *) first_node (ProtoList);
|
Prototype = (PROTOTYPE *) first_node (ProtoList);
|
||||||
if (Prototype->Variance.Elliptical != nullptr) {
|
free(Prototype->Variance.Elliptical);
|
||||||
memfree(Prototype->Variance.Elliptical);
|
Prototype->Variance.Elliptical = nullptr;
|
||||||
Prototype->Variance.Elliptical = nullptr;
|
free(Prototype->Magnitude.Elliptical);
|
||||||
}
|
Prototype->Magnitude.Elliptical = nullptr;
|
||||||
if (Prototype->Magnitude.Elliptical != nullptr) {
|
free(Prototype->Weight.Elliptical);
|
||||||
memfree(Prototype->Magnitude.Elliptical);
|
Prototype->Weight.Elliptical = nullptr;
|
||||||
Prototype->Magnitude.Elliptical = nullptr;
|
|
||||||
}
|
|
||||||
if (Prototype->Weight.Elliptical != nullptr) {
|
|
||||||
memfree(Prototype->Weight.Elliptical);
|
|
||||||
Prototype->Weight.Elliptical = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user