]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/decodermenu.cpp
Fix #1035 by checking for exceptions when accessing config
[pulseview.git] / pv / widgets / decodermenu.cpp
index 994aad1b4e5669f244edb9e4ba2c690c2cfa55be..28b54babdfb9aad3c0e67e2a732b22ac79cbe918 100644 (file)
@@ -30,9 +30,9 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
        QMenu(parent),
        mapper_(this)
 {
-       GSList *l = g_slist_sort(g_slist_copy(
+       GSList *li = g_slist_sort(g_slist_copy(
                (GSList*)srd_decoder_list()), decoder_name_cmp);
-       for (; l; l = l->next) {
+       for (GSList *l = li; l; l = l->next) {
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
 
@@ -46,7 +46,7 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
                                &mapper_, SLOT(map()));
                }
        }
-       g_slist_free(l);
+       g_slist_free(li);
 
        connect(&mapper_, SIGNAL(mapped(QObject*)),
                this, SLOT(on_action(QObject*)));
@@ -68,5 +68,5 @@ void DecoderMenu::on_action(QObject *action)
        decoder_selected(dec);
 }
 
-} // widgets
-} // pv
+}  // namespace widgets
+}  // namespace pv