]> sigrok.org Git - pulseview.git/blobdiff - pv/view/decodetrace.cpp
Store annotations as objects emplaced in the vector
[pulseview.git] / pv / view / decodetrace.cpp
index 2d641827f13bbd8416f09baa62f74c18cdce5a47..e582d1a8e2042d1ba4d4f2dd1046940bd8067990 100644 (file)
@@ -135,12 +135,10 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right)
        const int y = get_y();
 
        assert(_decoder_stack);
-       vector< shared_ptr<Annotation> > annotations(_decoder_stack->annotations());
-       BOOST_FOREACH(shared_ptr<Annotation> a, annotations) {
-               assert(a);
-               a->paint(p, get_text_colour(), h, left, right,
+       vector<Annotation> annotations(_decoder_stack->annotations());
+       BOOST_FOREACH(const Annotation &a, annotations)
+               a.paint(p, get_text_colour(), h, left, right,
                        samples_per_pixel, pixels_offset, y);
-       }
 
        draw_unresolved_period(p, h, left, right,
                samples_per_pixel, pixels_offset);