Skip to content

Commit ee8ad8e

Browse files
author
lukas.molzberger
committed
- fix
1 parent c6c62e9 commit ee8ad8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/network/aika/elements/activations/Activation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ public Activation<N> instantiateTemplateNode() {
533533
N n = null;
534534
if(doc.getInstantiationCallback() != null) {
535535
n = (N) doc.getInstantiationCallback().resolveInstance(neuron, doc);
536-
n.getProvider().increaseRefCount(TEMPLATE);
537536
}
538537

539538
boolean newNeuronInstance = false;
@@ -559,7 +558,8 @@ public Activation<N> instantiateTemplateNode() {
559558
if(ti != null && ti.getLabel() != null)
560559
getModel().registerLabel(ti.getNeuron(), neuron);
561560

562-
n.getProvider().decreaseRefCount(TEMPLATE);
561+
if(newNeuronInstance)
562+
n.getProvider().decreaseRefCount(TEMPLATE);
563563

564564
return ti;
565565
}

0 commit comments

Comments
 (0)