[Bug 90345] Kompare 3.3 crashes on a big diff file
Jeff Snyder
jeff-kdecvs at caffeinated.me.uk
Tue Aug 9 11:02:56 CEST 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=90345
jeff-kdecvs caffeinated me uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From jeff-kdecvs caffeinated me uk 2005-08-09 11:02 -------
SVN commit 444219 by je4d:
put the levenstein table on the stack, not the heap, and hence only allocate mem for it when needed, rather than having 65k*(number of files) allocated all the time.
BUG: 90345
CCMAIL: bruggie home nl
M +4 -10 difference.cpp
M +1 -1 difference.h
--- branches/KDE/3.5/kdesdk/kompare/libdiff2/difference.cpp #444218:444219
@ -26,14 +26,12 @
m_type( type ),
m_sourceLineNo( sourceLineNo ),
m_destinationLineNo( destinationLineNo ),
- m_applied( false ),
- m_table( new LevenshteinTable() )
+ m_applied( false )
{
}
Difference::~Difference()
{
- delete m_table;
}
void Difference::addSourceLine( QString line )
@ -63,6 +61,7 @
void Difference::determineInlineDifferences()
{
+ LevenshteinTable table;
if ( m_type != Difference::Change )
return;
@ -80,15 +79,10 @
DifferenceString* dl = destinationLineAt( i );
// FIXME: If the table cant be created dont do the rest
- m_table->createTable( sl, dl );
+ table.createTable( sl, dl );
- m_table->createListsOfMarkers();
+ table.createListsOfMarkers();
}
-
- // No longer needed, if we ever need to recalculate the inline differences we should
- // simply recreate the table
- delete m_table;
- m_table = 0;
}
QString Difference::recreateDifference() const
--- branches/KDE/3.5/kdesdk/kompare/libdiff2/difference.h #444218:444219
@ -210,7 +210,7 @
bool m_applied;
bool m_conflicts;
- LevenshteinTable* m_table;
+ LevenshteinTable* m_tableXXX; // now unused
};
typedef QValueList<Difference*> DifferenceList;
More information about the Kompare-devel
mailing list