简体   繁体   中英

App Extension: multiple instances interfering with each other

I'm building an iOS App Extension (an Audio Unit plugin in this case). The code is a mix of Objective-C, C++ and C files.

When I run one instance of my Audio Unit in a host it works fine, but once I open another one the two instances start to interfere with each other. It seems that both instances are unexpectedly sharing some variables between them and I suspect it's happening somewhere in the C libraries I'm using.

I'm using lots of 'static' declared variables in my .m files to ensure they have file-scope. Am I right in assuming that each instance of the Extension will also have its own instance of each static variable, even when they are declared in a C library? Or is using C a bad architectural choice in this case?

是的,实际上相同音频单元扩展的多个实例共享相同的过程,这是非常令人惊讶的,并且没有记录在任何地方(好像有关音频单元的任何记录!)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM