Revision 538:8ffb8985ae8f vamp-hostsdk/PluginWrapper.h

View differences:

vamp-hostsdk/PluginWrapper.h
56 56
 * override only the methods that are meaningful for the particular
57 57
 * adapter.
58 58
 *
59
 * A PluginWrapper takes ownership of the plugin it wraps, and deletes
60
 * it when it is itself deleted. To prevent this, call disownPlugin().
61
 *
59 62
 * \note This class was introduced in version 1.1 of the Vamp plugin SDK.
60 63
 */
61 64

  
......
121 124
        return 0;
122 125
    }
123 126

  
127
    /**
128
     * Disown the wrapped plugin, so that we no longer delete it on
129
     * our own destruction. The identity of the wrapped plugin is
130
     * unchanged, but this switches the expectation about ownership so
131
     * that the caller is expected to handle the lifecycle of the
132
     * wrapped plugin and to ensure that it outlasts this wrapper.
133
     *
134
     * This is not the normal model, but could be useful in situations
135
     * where a plugin is already managed using a smart pointer model
136
     * before being adapted into this wrapper. Note that this can't be
137
     * reversed - if you call this, you must subsequently take charge
138
     * of the wrapped plugin yourself.
139
     */
140
    void disownPlugin();
141
    
124 142
protected:
125 143
    PluginWrapper(Plugin *plugin); // I take ownership of plugin
126 144
    Plugin *m_plugin;
145
    bool m_pluginIsOwned;
127 146
};
128 147

  
129 148
}

Also available in: Unified diff