Re: gwenview crashing after watch videos

Carles Pina i Estany <[email protected]>
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
Hello,

On Aug/02/2007, Angelo Naselli wrote:
> Alle giovedì 2 agosto 2007, Carles Pina i Estany ha scritto:

> > Maybe next days I will try to reproduce the problem in very small
> > application, I will see. I am not sure if i will be able to do before
> > holidays.
> 
> have a nice time then ;)

holidays starts at saturday, thank you

I don't know if kphotoalbum crashes or no, but kphotoalbum video code is
based on gwenview code. There is a comment in source code and i could
see it before :) (some strings are the same)

I have done a small test. My code is as simple as could be. Code is:
-----------
test2::test2() : KMainWindow( 0, "test2" )
{
    // set the shell's ui resource file
    setXMLFile("test2ui.rc");

    //TEST
    KURL url("/home/carles/proves/linuxshow_video_352x288.mpg");
    QString mimeType=KMimeType::findByURL(url)->name();
    std::cerr<<"TEST"<<endl;
    //printf("mimeType: %s\n",qPrintable(mimeType));

    KService::Ptr service = KServiceTypeProfile::preferredService(mimeType, "KParts/ReadOnlyPart");
    std::cerr << "Here1" << endl;

    if (!service) {
        std::cerr << "No service problem" << endl;
        return;
    }
    QString library=service->library();
    std::cerr << "Library: " << library;
    Q_ASSERT(!library.isNull());


    QWidget widget;

    mPlayerPart = KParts::ComponentFactory::createPartInstanceFromService<KParts::ReadOnlyPart>(service, this);//mStack, 0, mStack, 0);

    if (!mPlayerPart) {
        std::cerr << "Problem in mPlayerPart" << endl;
        return;
    }
    mPlayerPart->openURL(url.url());
}

test2::~test2()
{
        std::cerr << "Destructor" << endl;
        mPlayerPart->closeURL();
        sleep(2);
        std::cerr<<"After sleep" << endl;
        delete mPlayerPart;
        mPlayerPart=0;
        std::cerr <<"After delete" << endl;
        sleep(2);
}
-----------

Ok, it is bad code. But I hope that enough to see what happends.

This application is crashing after last sleep(2) in destructor! I can 
delete the mPlayerPart, etc. (and really it stops to play the video) but 
then it crashes.

I see that we it is using libxine library. Searching in google for 
"libxinepart crash" or "libxine crash", there is more applications with 
the same problem (video players, mainly). Even some applicatoins are not
related with KDE, so maybe the problem is not in KDE side and is in lower
level. Don't know.

I think that it isn't a gwenview problem. Do you want that I report this
problem in some other mailing list or bugtrack? I guess that you know 
more than the way how to report this things :-) (specially if it is KDE
bug)

And I think that we was waiting to fix this bug to release new 
gwenview version. I don't think that makes sense to not release 
gwenview version for some non-gwenview bug. I am thinking about 
some workaround. Some weeks ago i tried lot of things without good
result.

I did the code using kdevelop. Whole project is here:
http://pinux.info/fitxers/test2.tar.bz2 . I see that this file is big, 
it contains the executable.
Be carefull compiling again, I had a problem linking with -lkparts o -lkio 
and I wrote some libraries straight in acinclude.m4 macros :-| or in 
Makefile

Any more ideas?

-- 
Carles Pina i Estany		GPG id: 0x8CBDAE64
	http://pinux.info	Manresa - Barcelona

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.