<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QPluginLoader]]></title><description><![CDATA[<p dir="auto">Hi Developer Network,</p>
<p dir="auto">I'm working over plugin arquitecture aproach, but I have a question about plugin loader.<br />
If I call QPluginLoader::unload(), the loader free reserved memory for loaded object? or have I call delete operator?.</p>
<p dir="auto">@QObject *pluginInstance = m_loader.instance();<br />
if (!pluginInstance)<br />
continue;<br />
PluginFactory *pluginFactory = qobject_cast&lt;PluginFactory *&gt;(pluginInstance);</p>
<p dir="auto">if (!pluginFactory)<br />
continue;</p>
<p dir="auto">Plugin *plugin = pluginFactory-&gt;plugin(); // PluginFactory::plugin() { return new Plugin(); }</p>
<p dir="auto">if (!plugin)<br />
continue;</p>
<p dir="auto">m_loader.unload();</p>
<p dir="auto">// delete plugin;@</p>
<p dir="auto">Thank you for your help ;)</p>
]]></description><link>https://forum.qt.io/topic/18772/qpluginloader</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 16:01:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/18772.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Aug 2012 14:30:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QPluginLoader on Wed, 01 Aug 2012 18:37:16 GMT]]></title><description><![CDATA[<p dir="auto">;)</p>
<p dir="auto">Ok DerManu,</p>
<p dir="auto">Thank you for your explanation (about QPluginLoader). I'll check my memory management.</p>
<p dir="auto">BR,</p>
]]></description><link>https://forum.qt.io/post/146284</link><guid isPermaLink="true">https://forum.qt.io/post/146284</guid><dc:creator><![CDATA[Thanatos.jsse]]></dc:creator><pubDate>Wed, 01 Aug 2012 18:37:16 GMT</pubDate></item><item><title><![CDATA[Reply to QPluginLoader on Wed, 01 Aug 2012 17:50:20 GMT]]></title><description><![CDATA[<p dir="auto">This depends on whether "plugin" is a child (QObject) of pluginInstance/pluginFactory. on mloader.unload(), pluginFactory is deleted. if "plugin" is not associated with the other classes anymore, you're responsible for the memory.</p>
<p dir="auto">//EDIT: And since you create it via "new Plugin();" and not "new Plugin(this);", it isn't a child of the factory and you'll need to delete it yourself.</p>
]]></description><link>https://forum.qt.io/post/146279</link><guid isPermaLink="true">https://forum.qt.io/post/146279</guid><dc:creator><![CDATA[DerManu]]></dc:creator><pubDate>Wed, 01 Aug 2012 17:50:20 GMT</pubDate></item></channel></rss>