# How do I release a shared license?

Follow
0 out of 0 found this helpful
Have more questions? Submit a request

So, if I do not call dispose on all the models before disposing the environment, the license is not getting released? Could you clarify this for me?

Because it certainly does not throw an exception and I can still perform optimizations on the model after disposing the environment. This should be clarified in the documentation if that is the case. As it is worded right now,

The dispose method on a GRBEnv should be called only after you have calleddispose on all of the models that were created within that environment.

it sounds to me, that I can just elect to not close the models first, if I'm not going to use them after disposing the environment.

Dear Patrick,

You are correct in assuming that the license may not be released after the environment is disposed of if there is a model that is still active.

You should always dispose of all models inside an environment before disposing of the environment as it is stated in the documentation. Otherwise, this can cause undefined behavior even is there is no error or warning message.

Best regards,
Matthias