If parent is null then derenferencing it will cause a segfault.
From: Erik Hovland <erik@hovland.org>
---
mythtv/libs/libmythui/xmlparsebase.cpp | 56 ++++++++++++++++----------------
1 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/mythtv/libs/libmythui/xmlparsebase.cpp b/mythtv/libs/libmythui/xmlparsebase.cpp
index 320fdfe..027d105 100644
a
|
b
|
void XMLParseBase::ParseChildren(QDomElement &element, |
181 | 181 | if (!info.isNull()) |
182 | 182 | { |
183 | 183 | QString type = info.tagName(); |
184 | | if (parent->ParseElement(info)) |
| 184 | if (!(parent && parent->ParseElement(info))) |
185 | 185 | { |
186 | | } |
187 | | else if (type == "font") |
188 | | { |
189 | | MythFontProperties *font; |
190 | | bool global = (GetGlobalObjectStore() == parent); |
191 | | font = MythFontProperties::ParseFromXml(info, global); |
192 | | if (!global && font) |
| 186 | if (type == "font") |
193 | 187 | { |
194 | | QString name = info.attribute("name"); |
195 | | parent->AddFont(name, font); |
196 | | } |
| 188 | MythFontProperties *font; |
| 189 | bool global = (GetGlobalObjectStore() == parent); |
| 190 | font = MythFontProperties::ParseFromXml(info, global); |
| 191 | if (!global && font) |
| 192 | { |
| 193 | QString name = info.attribute("name"); |
| 194 | parent->AddFont(name, font); |
| 195 | } |
197 | 196 | |
198 | | if (font) |
199 | | delete font; |
200 | | } |
201 | | else if (type == "imagetype" || |
202 | | type == "textarea" || |
203 | | type == "group" || |
204 | | type == "textedit" || |
205 | | type == "button" || |
206 | | type == "buttonlist" || |
207 | | type == "buttonlist2" || |
208 | | type == "spinbox" || |
209 | | type == "checkbox" || |
210 | | type == "statetype" || |
211 | | type == "clock" || |
212 | | type == "progressbar") |
213 | | { |
214 | | ParseUIType(info, type, parent); |
| 197 | if (font) |
| 198 | delete font; |
| 199 | } |
| 200 | else if (type == "imagetype" || |
| 201 | type == "textarea" || |
| 202 | type == "group" || |
| 203 | type == "textedit" || |
| 204 | type == "button" || |
| 205 | type == "buttonlist" || |
| 206 | type == "buttonlist2" || |
| 207 | type == "spinbox" || |
| 208 | type == "checkbox" || |
| 209 | type == "statetype" || |
| 210 | type == "clock" || |
| 211 | type == "progressbar") |
| 212 | { |
| 213 | ParseUIType(info, type, parent); |
| 214 | } |
215 | 215 | } |
216 | 216 | } |
217 | 217 | } |