[Interest] App crashing because of ImageProvider when exiting
Jean-Michaël Celerier
jeanmichael.celerier at gmail.com
Wed Jul 25 12:30:44 CEST 2018
Shouldn't you allocate your ImageProvider on the heap or at least ensure
that it survives during the whole execution ? here it will be deleted by
the end of your function
-------
Jean-Michaël Celerier
http://www.jcelerier.name
On Wed, Jul 25, 2018 at 11:24 AM, Nuno Santos <nunosantos at imaginando.pt>
wrote:
> Hi,
>
> Yesterday I have used for the first time a QQuickImageProvider but I’m
> having problems because now the app crashes when I terminate it.
>
> Tried to do the following in order to avoid the crash but it is crashing
> anyway:
>
> ImageProvider imageProvider;
> engine.addImageProvider("pictures", &imageProvider);
>
> QObject::connect(&app, &QGuiApplication::aboutToQuit, [=]()
> {
> e->removeImageProvider("pictures");
> });
>
> The crash is always something like this:
>
> malloc: *** error for object 0x7ffeef34e900: pointer being freed was not
> allocated
>
> Does anyone knows how to fix this?
>
> Thanks!
>
> Regards,
>
> Nuno
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180725/cf6c8b07/attachment.html>
More information about the Interest
mailing list