View Single Post
Old 10 August 2021, 15:19   #25
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
It depends on what you do in your library base. If it only contains constants that are initialized once in LibInit, then there is no problem to use a common library base for all library opener. If not, it can become a bit tricky.

In most cases, however, it is better practice to put such "state variables" in a state that is allocated through a dedicated library function , and also released by a library function.

Think of intuition windows. The "window structure" is actually a big "state variable" intuition creates, deletes and works on. Since intuition has multiple such state variables (windows, screens,...) it is better to have separate "constructors" and "destructors" for them instead of putting them all into the library base.
Thomas Richter is offline  
 
Page generated in 0.05716 seconds with 11 queries