← Back to team overview

unity-api-bugs team mailing list archive

[Bug 1244468] [NEW] GVariants leaked in service.vala's volume_changed()

 

Public bug reported:

The implicitly-created GVariant is leaked in Service's volume_changed()
function. We can fix it by making the variant explicit. But, should this
be reported upstream as a Vala bug?

One line diff:
- volume_action.set_state (volume);
+ volume_action.set_state (new Variant.double (volume));

C code generated from "volume_action.set_state (volume)":

  static GVariant* _variant_new4 (gdouble value) {
    return g_variant_ref_sink (g_variant_new_double (value));
  }
  static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
    ...
    _tmp3_ = volume;
   _tmp4_ = _variant_new4 (_tmp3_);
    g_simple_action_set_state (volume_action, _tmp4_);
    ...
  }

C code generated from "volume_action.set_state (new Variant.double
(volume))":

  static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
    ...
    _tmp3_ = volume;
    _tmp4_ = g_variant_new_double (_tmp3_);
    g_variant_ref_sink (_tmp4_);
    _tmp5_ = _tmp4_;
    g_simple_action_set_state (volume_action, _tmp5_);
    _g_variant_unref0 (_tmp5_);
    ...
  }

** Affects: indicator-sound
     Importance: Medium
         Status: New

** Changed in: indicator-sound
   Importance: Undecided => Medium

** Branch linked: lp:~charlesk/indicator-sound/lp-1244468

** Description changed:

  The implicitly-created GVariant is leaked in Service's volume_changed()
  function. We can fix it by making the variant explicit. But, should this
  be reported upstream as a Vala bug?
  
  One line diff:
  - volume_action.set_state (volume);
  + volume_action.set_state (new Variant.double (volume));
  
- 
  C code generated from "volume_action.set_state (volume)":
  
-   static GVariant* _variant_new4 (gdouble value) {
-     return g_variant_ref_sink (g_variant_new_double (value)); 
-   }
-   static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
-     ...
-     _tmp3_ = volume;
-    _tmp4_ = _variant_new4 (_tmp3_);
-     g_simple_action_set_state (volume_action, _tmp4_);
-     ...
-   }
+   static GVariant* _variant_new4 (gdouble value) {
+     return g_variant_ref_sink (g_variant_new_double (value));
+   }
+   static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
+     ...
+     _tmp3_ = volume;
+    _tmp4_ = _variant_new4 (_tmp3_);
+     g_simple_action_set_state (volume_action, _tmp4_);
+     ...
+   }
  
+ C code generated from "volume_action.set_state (new Variant.double
+ (volume))":
  
- C code generated from "volume_action.set_state (new Variant.double (volume))":
- 
-   static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
-     ...
-     _tmp3_ = volume;
-     _tmp4_ = g_variant_new_double (_tmp3_);
-     g_variant_ref_sink (_tmp4_);
-     _tmp5_ = _tmp4_;
-     ...
-     _g_variant_unref0 (_tmp5_);
-     ...
-   }
+   static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
+     ...
+     _tmp3_ = volume;
+     _tmp4_ = g_variant_new_double (_tmp3_);
+     g_variant_ref_sink (_tmp4_);
+     _tmp5_ = _tmp4_;
+     g_simple_action_set_state (volume_action, _tmp5_);
+     _g_variant_unref0 (_tmp5_);
+     ...
+   }

-- 
You received this bug notification because you are a member of Unity API
bugs, which is subscribed to The Sound Menu.
https://bugs.launchpad.net/bugs/1244468

Title:
  GVariants leaked in service.vala's volume_changed()

Status in Sound Menu:
  New

Bug description:
  The implicitly-created GVariant is leaked in Service's
  volume_changed() function. We can fix it by making the variant
  explicit. But, should this be reported upstream as a Vala bug?

  One line diff:
  - volume_action.set_state (volume);
  + volume_action.set_state (new Variant.double (volume));

  C code generated from "volume_action.set_state (volume)":

    static GVariant* _variant_new4 (gdouble value) {
      return g_variant_ref_sink (g_variant_new_double (value));
    }
    static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
      ...
      _tmp3_ = volume;
     _tmp4_ = _variant_new4 (_tmp3_);
      g_simple_action_set_state (volume_action, _tmp4_);
      ...
    }

  C code generated from "volume_action.set_state (new Variant.double
  (volume))":

    static void indicator_sound_service_volume_changed (IndicatorSoundService* self, gdouble volume) {
      ...
      _tmp3_ = volume;
      _tmp4_ = g_variant_new_double (_tmp3_);
      g_variant_ref_sink (_tmp4_);
      _tmp5_ = _tmp4_;
      g_simple_action_set_state (volume_action, _tmp5_);
      _g_variant_unref0 (_tmp5_);
      ...
    }

To manage notifications about this bug go to:
https://bugs.launchpad.net/indicator-sound/+bug/1244468/+subscriptions


Follow ups

References