deactivate-model ( model -- )
Models
Prev:activate-model ( model -- )
Next:Implementing models


Vocabulary
models

Inputs and outputs
modela model


Word description
Decrements the reference count of the model. If it reaches zero, this model is removed as a connection from all models registered as dependencies by add-dependency.

Warning
Calls to activate-model and deactivate-model should be balanced to keep the reference counting consistent, otherwise model-changed might be called at the wrong time or not at all.


See also
model-activated, activate-model

Definition
USING: accessors kernel math sequences ;

IN: models

: deactivate-model ( model -- )
dup unref-model zero? [
dup dependencies>>
[ dup deactivate-model remove-connection ] with each
] [ drop ] if ;