After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 541102 - Switching to Mini Mode when a track is paused leads to a crash
Switching to Mini Mode when a track is paused leads to a crash
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other All
: Normal critical
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-01 15:57 UTC by Bertrand Lorentz
Modified: 2008-07-25 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix the crash by moving the BuildLayout call to the constructor (685 bytes, patch)
2008-07-01 16:02 UTC, Bertrand Lorentz
none Details | Review
Fix the crash, fix a style issue (1.94 KB, patch)
2008-07-25 20:44 UTC, Aaron Bockover
committed Details | Review

Description Bertrand Lorentz 2008-07-01 15:57:25 UTC
Steps to reproduce:
1. Start banshee
2. Play a track
3. Pause the track
4. Click on View > MiniMode


Stack trace:
Object reference not set to an instance of an object
System.NullReferenceException: Object reference not set to an instance of an object
  at Banshee.Widgets.StreamPositionLabel.UpdateLabel (System.String text) [0x00000] in /home/lorentz/Projets/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs:150 
  at Banshee.Widgets.StreamPositionLabel.UpdateLabel () [0x000db] in /home/lorentz/Projets/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs:143 
  at Banshee.Widgets.StreamPositionLabel.OnSliderUpdated (System.Object o, System.EventArgs args) [0x00000] in /home/lorentz/Projets/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/StreamPositionLabel.cs:165 
  at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr gch) [0x00000] 
  at (wrapper native-to-managed) GLib.Signal:voidObjectCallback (intptr,intptr)
  at (wrapper managed-to-native) Gtk.Range:gtk_range_set_value (intptr,double)
  at Gtk.Range.set_Value (Double value) [0x00000] 
  at Banshee.Widgets.SeekSlider.set_SeekValue (Int64 value) [0x00028] in /home/lorentz/Projets/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/SeekSlider.cs:113 
  at Banshee.Gui.Widgets.ConnectedSeekSlider.OnPlayerEngineTick () [0x00050] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs:179 
  at Banshee.Gui.Widgets.ConnectedSeekSlider..ctor (SeekSliderLayout layout) [0x00086] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs:72 
  at Banshee.Gui.Widgets.ConnectedSeekSlider..ctor () [0x00000] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs:48 
  at Banshee.MiniMode.MiniMode.Initialize () [0x0017e] in /home/lorentz/Projets/banshee/src/Extensions/Banshee.MiniMode/Banshee.MiniMode/MiniModeWindow.cs:106 
<snip>

Other information:
It seems that the pango layout is instantiated after the StreamPositionLabel is realized, but OnSliderUpdated is triggered before that, causing the crash.

This is probably triggered by the change made for bug #536564.

I'll post a patch that fixes the crash
Comment 1 Bertrand Lorentz 2008-07-01 16:02:04 UTC
Created attachment 113788 [details] [review]
Fix the crash by moving the BuildLayout call to the constructor

As I don't know anything about Pango, I don't know if it's the right way to do things, but it fixes the problem for me.
Comment 2 Aaron Bockover 2008-07-25 20:44:45 UTC
Created attachment 115272 [details] [review]
Fix the crash, fix a style issue

Hi Bertrand. Your patch works, but it's more correct to create the layout only when the widget becomes realized. My fix just adds a few tests in UpdateLayout to ensure the widget has been realized and the layout available. 

I found some extra unrelated issue when testing as well. The layout was never rebuilt when font size is changed. This patch also addresses that.

Thanks!