[QScintilla] QsciApis crash

Gedalia Pasternak gedalia at gmail.com
Wed Jul 2 20:44:19 BST 2008


Is anyone else seeing a crash or memory scribbles when the QSciAPIs object
is destroyed?

The following code is bringing down my app when I destroy the widget
(running qt3, with quite a number of api entries.)

QWidgetCodeEditor::QWidgetCodeEditor(QWidget *parent, const char *name,
WFlags f ) :
      QsciScintilla(parent, name,f)
{
    m_lua_lexer = new bdiLexerLua();
    m_lua_apis  = new QsciAPIs(m_lua_lexer);
    m_lua_lexer->setAPIs(m_lua_apis);

    m_perl_lexer = new QsciLexerPerl();
    m_perl_apis  = new QsciAPIs(m_perl_lexer);
    m_perl_lexer->setAPIs(m_perl_apis);

    m_initted = 0;
}


/****************************************************************************/
QWidgetCodeEditor::~QWidgetCodeEditor()
{
   m_perl_lexer->setAPIs(NULL);
    m_perl_apis->cancelPreparation();
    delete m_perl_apis; m_perl_apis = NULL;

    m_lua_lexer->setAPIs(NULL);
    m_lua_apis->cancelPreparation();
    delete m_lua_apis; m_lua_apis = NULL;

    delete m_lua_lexer; m_lua_lexer = NULL;
    delete m_perl_lexer; m_perl_lexer = NULL;
}


-- 
---------------------------------------------------------------
cel: 917.776.8346 AIM: gedaliap
http://www.gedalia.net
---------------------------------------------------------------
Fight Entropy!!! Fight Entropy!!! Figth Etnropy! !
iFgth Etnrop!y ! giFth tErno!py ! giFt htrEno!p y! --- Well maybe
not...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20080702/d6399b26/attachment.html


More information about the QScintilla mailing list