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 375558 - Devices are not unregistering properly
Devices are not unregistering properly
Status: RESOLVED FIXED
Product: lsr
Classification: Deprecated
Component: core
0.3.x
Other All
: Normal normal
: 0.4.0
Assigned To: LSR maintainers
LSR maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-15 15:30 UTC by Scott Haeger
Modified: 2006-11-15 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Scott Haeger 2006-11-15 15:30:52 UTC
Please describe the problem:
Devices are not unregistering properly thus persistence is lost from settings

Steps to reproduce:
1. More than one input or output device must be registered.
2. Pull up settings dialog and change settings for a device.  FestivalSpeech is first device so problem won't show up for it.
3. Quit LSR.
4.  Start LSR and see if settings persisted.


Actual results:
The settings for the device will not persist

Expected results:
The settings should persist through multiple runs of LSR.

Does this happen every time?
Yes, this happens everytime.

Other information:
The problem is in DeviceManager.py.  The close method iterates through both the input and output devices and calls unRegisterDevice for each.  unRegisterDevice removes the device from the list which corrupts iterator in the close method.  The solution is to make a copy of the list ie.  for d in self.out_devs[:]: for both output and input loops.  The unRegisterDevice may be best broken into two methods unRegisterOutputDevice and unRegisterInputDevice.  Also, the unloadDevices method is not being called.  It may be a candidate for removal.
Comment 1 Peter Parente 2006-11-15 17:36:05 UTC
Nice catch. Bug is now fixed in CVS. unloadDevices is being called from elsewhere in the system to support the runtime switching of preffered devices from the settings dialog. I've improved the comments so it's clearer why we have similar code in close() and in unloadDevices(). One day, they'll be merged.