Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Issue 81: Fix CPO memory leak

Unified Diff

File: translate/storage/base.py
Patch Set: Created 1 year, 4 months ago
Jump to:
View side by-side-diff with in line comments
« no previous file | translate/storage/cpo.py » ('j')
Index: translate/storage/base.py
===================================================================
--- translate/storage/base.py	(revision 8018)
+++ translate/storage/base.py	(working copy)
@@ -301,8 +301,8 @@
         """Build a native unit from a foreign unit, preserving as much  
         information as possible."""
 
-        if type(unit) == cls and hasattr(unit, "copy") and callable(unit.copy):
-            return unit.copy()
+        #if type(unit) == cls and hasattr(unit, "copy") and callable(unit.copy):
+        #    return unit.copy()
         newunit = cls(unit.source)
         newunit.target = unit.target
         newunit.markfuzzy(unit.isfuzzy())
@@ -374,7 +374,7 @@
 
         unit = self.UnitClass(source)
         self.addunit(unit)
-        return unit
+        return self.units[-1]
 
     def findunit(self, source):
         """Finds the unit with the given source string.

« no previous file | translate/storage/cpo.py » ('j')

Powered by Google App Engine
This is Rietveld r159