Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a safe reference counter for initialization/deinitialization #47

Merged
merged 4 commits into from
May 2, 2020

Conversation

jjceresa
Copy link
Contributor

@jjceresa jjceresa commented May 1, 2020

This counter is necessary, when the application makes use of multiples libraries each dependent of libinstpatch. Examples:

  • Swami is dependent of libinstpatch and fluidsynth. fluidsynth could be optionally dependent of libinstpatch. In this case libinstpatch is owned twice (by swami and by fluidsynth).
  • For an application only dependent of fluidsynth, libinstpatch is only owned by fluidsynth.
  • For an application only dependent of libinstpatch, libinstpatch is only owned by this application.

This counter ensures that internal initialization (or deinitialization) is done only one time.
This is required because libinstpatch is dependent of GObject which doesn't accept that the same Gtype be registered multiple times.

@jjceresa jjceresa changed the title Adding a safe refererence counter for initialization/deinitialization Adding a safe reference counter for initialization/deinitialization May 1, 2020
@derselbst derselbst merged commit a1af56b into master May 2, 2020
@derselbst derselbst deleted the init-deinit-cpt branch May 2, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants