Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-15 Thread Thiago Macieira
Em sábado, 15 de outubro de 2016, às 15:33:53 PDT, Liang Jian escreveu:
> But I am still curious about that If we don't unload the plugin, will
> the destructor of the gobal object in it be called? If it is not called,
> what if the gobal object of the plugin hold some memory allocated from heap?

It's easy to test.

In any case, I don't consider leaks those that happen because the memory 
wasn't freed at program exit while holding a pointer to it. In fact, neither 
does valgrind: those are "still reachable" allocations.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-15 Thread Liang Jian
Yes, you are right. After applying the patch from
https://codereview.qt-project.org/#/c/140750/ I didn't notice any leak
report under Windows.
Sorry for the noise.

But I am still curious about that If we don't unload the plugin, will
the destructor of the gobal object in it be called? If it is not called,
what if the gobal object of the plugin hold some memory allocated from heap?

On Sat, Oct 15, 2016 at 2:07 AM, Thiago Macieira 
wrote:

> Em sexta-feira, 14 de outubro de 2016, às 16:08:27 PDT, Liang Jian
> escreveu:
> > I don't care custom plugin, What I care is the plugins loaded by qt
> > itself, such as qpa plugin, images format plugins ..., These plugins are
> > needed for all qt programs, we can't avoid the leaks caused by not
> > unloading these plugins if my understanding to this issue is right (Maybe
> > you don't think that are leaks but they will confuse memory leak
> detector),
> > that is why I hope to introduce a method to disable this feature at
> runtime.
>
> What do you prefer?
>
> 1) leak
> 2) crash and leak
>
> Either way, the dlclose() call will not happen.
>
> Note that this has nothing to do with freeing memory. Only the dlclose().
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development