Skip to content
Browse files

avoid returning dangling ref in ServerInfo::GetDefault()

  • Loading branch information...
1 parent d48dd97 commit 39d61e9e59dc838ecbf09fd03439cf835e24f259 @falconindy committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 pulse.h
View
5 pulse.h
@@ -112,15 +112,16 @@ class Card {
struct ServerInfo {
string sink;
string source;
+ string empty = "";
- const string GetDefault(enum DeviceType type) {
+ const string& GetDefault(enum DeviceType type) {
switch (type) {
case DEVTYPE_SINK:
return sink;
case DEVTYPE_SOURCE:
return source;
default:
- return "";
+ return empty;
}
}
};

0 comments on commit 39d61e9

Please sign in to comment.
Something went wrong with that request. Please try again.