Permalink
Browse files

Added intentional memory leak... Qscintilla is displaying strange beh…

…aivor again. sigh.
  • Loading branch information...
1 parent 1a2d811 commit 161bb5b1987004dca438f3c391c80942162ed088 @bmcdorman bmcdorman committed Jan 11, 2013
@@ -67,9 +67,7 @@ namespace Kiss
{
}
- virtual ~Base()
- {
- }
+ virtual ~Base();
const Constructor *constructor() const
{
@@ -102,6 +102,7 @@ void KovanInterface::found(const Advert &ad, const sockaddr_in& addr)
TcpSerial *serial = new TcpSerial(ha.toString().toAscii(), KOVAN_SERIAL_PORT);
KovanProtoTarget *device = new Kiss::Target::KovanProtoTarget(serial, this);
device->fillInformation(ad);
+ device->fillCommPort(ha.toString());
m_responder->targetFound(this, TargetPtr(device));
}
@@ -30,7 +30,7 @@ void KovanProtoTarget::fillDisplayName(const QString &displayName)
void KovanProtoTarget::fillCommPort(const QString &commPort)
{
- m_information[SERIAL] = commPort;
+ m_information[COMM_PORT] = commPort;
}
void KovanProtoTarget::fillInformation(const Advert &advert)
@@ -46,8 +46,6 @@ namespace Kiss
~C();
const bool cStyleBlocks() const;
- private:
- CLexer *m_lexer;
};
class ConstructorC : public Constructor
@@ -37,6 +37,8 @@ const QString& Constructor::name() const
Constructor::~Constructor() {}
+Base::~Base() {}
+
Settings::Settings() {}
Settings::~Settings() {}
View
@@ -229,9 +229,7 @@ bool SourceFile::openProjectFile(const Project::ProjectPtr& project)
void SourceFile::indentAll()
{
- if(!ui_editor->lexer()) return;
- Lexer::Base *lexerBase = dynamic_cast<Lexer::Base *>(ui_editor->lexer());
- if(!lexerBase || !lexerBase->cStyleBlocks()) return;
+ if(!m_currentLexer || !m_currentLexer->cStyleBlocks()) return;
setUpdatesEnabled(false);
@@ -702,12 +700,20 @@ void SourceFile::showFind()
void SourceFile::setLexer(Lexer::Constructor *constructor)
{
- if(m_currentLexer) m_currentLexer->constructor()->_delete(m_currentLexer);
+ ui_editor->setLexer(0);
+ if(m_currentLexer) {
+#ifdef Q_OS_WIN
+ m_currentLexer->constructor()->_delete(m_currentLexer);
+#else
+ // TODO: Move away from QScintilla before I lose my mind.
+ // delete m_currentLexer;
+#endif
+ }
m_currentLexer = 0;
if(!constructor) return;
m_currentLexer = constructor->construct();
ui_editor->setLexer(m_currentLexer->lexer());
- Lexer::Factory::setAPIsForLexer(m_currentLexer, m_lexAPI);
+ // Lexer::Factory::setAPIsForLexer(m_currentLexer, m_lexAPI);
refreshSettings();
updateMargins();
}

0 comments on commit 161bb5b

Please sign in to comment.