https://bugs.winehq.org/show_bug.cgi?id=50200
--- Comment #3 from Todd Chester ToddAndMargo@zoho.com --- The problem seems to only be associated with long printer names that are only different at the end of the name.
I created a printer called MickyMouse and Wine picked it up and dumped it after I deleted it.
So, I seems that you may need to increase the string (array of characters) you are using to read in the printer names. But that does not explain why you hold on to a defunct name, unless the comparison between old names and new names is also not being done on enough characters.