Kaydet (Commit) e639c4e2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Do not deref (potentially dangling) weak_ptr

Change-Id: Ic9694aa8bd85fe0548b8f5fc5f52b4bbd6dce1cf
üst 1413b6a4
......@@ -41,6 +41,16 @@ class SmartPtrPrinter:
else:
return "empty %s" % (self.typename)
class WeakPtrPrinter:
"""Prints boost::weak_ptr instances"""
def __init__(self, typename, value):
self.typename = typename
self.value = value
def to_string(self):
value = self.value['px']
return "%s %s" % (self.typename, value)
printer = None
......@@ -54,7 +64,7 @@ def build_pretty_printers():
printer.add('boost::shared_ptr', SmartPtrPrinter)
# printer.add('boost::shared_array', SmartPtrPrinter)
printer.add('boost::weak_ptr', SmartPtrPrinter)
printer.add('boost::weak_ptr', WeakPtrPrinter)
printer.add('boost::scoped_ptr', SmartPtrPrinter)
# printer.add('boost::scoped_array', SmartPtrPrinter)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment