mirror of https://github.com/BOINC/boinc.git
Feeder: more efficient solution to memory leak fix
The for loop copies newly created objects into the vector and destroys the original objects. The resize() instantiates the objects directly in the vector. Suggested by Nicolás Alvarez.
This commit is contained in:
parent
770fbf138f
commit
4eec734bc4
|
@ -560,11 +560,7 @@ void feeder_loop() {
|
||||||
|
|
||||||
// may need one enumeration per app; create vector
|
// may need one enumeration per app; create vector
|
||||||
//
|
//
|
||||||
for (int i=0; i<napps; i++) {
|
work_items.resize(napps);
|
||||||
DB_WORK_ITEM* wi = new DB_WORK_ITEM();
|
|
||||||
work_items.push_back(*wi);
|
|
||||||
delete wi;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
bool action;
|
bool action;
|
||||||
|
|
Loading…
Reference in New Issue