pipelined / vst2

Build vst2 plugins and hosts with Go
MIT License
135 stars 17 forks source link

Add dll pinning for windows to prevent dll unloading #50

Closed ryrun closed 3 years ago

ryrun commented 3 years ago

VST hosts like Renoise, FLStudio unloads the dll, when the last instance was removed from the song. This unloading causing a crash of the VST host on windows systems. With pinning, the dll gets only unloaded, when the main process (daw) will be closed.

Related to #45

dudk commented 3 years ago

Thank you for this contribution, @ryrun! The problem with this PR is that it refers to some symbols from syscall package are only available on windows and compilation for any other OS will be broken.

I left some comments in code to fix it, let me know if you have questions.

codecov[bot] commented 3 years ago

Codecov Report

Merging #50 (36fcc46) into master (7b55e1b) will decrease coverage by 2.07%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
- Coverage   46.01%   43.94%   -2.08%     
==========================================
  Files          10       12       +2     
  Lines         339      355      +16     
==========================================
  Hits          156      156              
- Misses        169      185      +16     
  Partials       14       14              
Impacted Files Coverage Δ
plugin_export_notwin.go 0.00% <0.00%> (ø)
plugin_export_windows.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7b55e1b...36fcc46. Read the comment docs.

ryrun commented 3 years ago

You mean in the code above the loadHook function for windows part?

dudk commented 3 years ago

On a second though, I think that adding it to this PR would give enough traceability. It can be merged as-is.

EDIT: nice comment!