Skip to content

Commit d2c92f1

Browse files
Carl HopfJuan Cazala
authored andcommitted
fix memory leak, remove unused code. (#274)
this.nerons[id] is a function, so ```this.neurons[id] = neuron``` will save neurons to this functions prototype and leak memory #164
1 parent ae9db75 commit d2c92f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export default class Layer {
197197

198198
// adds a neuron to the layer
199199
add(neuron) {
200-
this.neurons[neuron.ID] = neuron || new Neuron();
200+
neuron = neuron || new Neuron();
201201
this.list.push(neuron);
202202
this.size++;
203203
}

0 commit comments

Comments
 (0)