cppcheckdata: Use instance attributes in Cppcheckdata (#3029)
This commit makes CppcheckData class to use instance attributes instead of class attributes. Since class attributes are mutable (list), when you append to them, they don't promote to instance variable which means when you call parsedump() multiple times data just gets appended to them. Found by samed on the forum: https://sourceforge.net/p/cppcheck/discussion/general/thread/c6e1210ec2/
This commit is contained in:
parent
b6f4961e4a
commit
13b8ee8871
|
@ -852,15 +852,14 @@ class CppcheckData:
|
|||
@endcode
|
||||
"""
|
||||
|
||||
rawTokens = []
|
||||
platform = None
|
||||
suppressions = []
|
||||
|
||||
def __init__(self, filename):
|
||||
"""
|
||||
:param filename: Path to Cppcheck dump file
|
||||
"""
|
||||
self.filename = filename
|
||||
self.rawTokens = []
|
||||
self.platform = None
|
||||
self.suppressions = []
|
||||
|
||||
files = [] # source files for elements occurred in this configuration
|
||||
platform_done = False
|
||||
|
|
Loading…
Reference in New Issue