+2005-05-22 Adele Peterson <adele@apple.com>
+
+ Reviewed by Maciej.
+
+ fix for <rdar://problem/4127101> REGRESSION(412-TOT) crash when creating Option element
+
+ * khtml/ecma/kjs_html.cpp: (KJS::OptionConstructorImp::construct):
+ Changed ElementImpl pointer to a SharedPtr because it was getting destroyed before we were done with it.
+
2005-05-20 John Sullivan <sullivan@apple.com>
Reviewed by Chris.
Object OptionConstructorImp::construct(ExecState *exec, const List &args)
{
int exception = 0;
- ElementImpl *el = m_doc->createElement("option", exception);
+ SharedPtr<ElementImpl> el(m_doc->createElement("option", exception));
HTMLOptionElementImpl *opt = 0;
- if (el) {
- el->ref();
- opt = static_cast<HTMLOptionElementImpl *>(el);
+ if (el.notNull()) {
+ opt = static_cast<HTMLOptionElementImpl *>(el.get());
int sz = args.size();
TextImpl *t = m_doc->createTextNode("");
t->ref();
if (exception == 0 && sz > 3)
opt->setSelected(args[3].toBoolean(exec));
t->deref();
- el->deref();
}
setDOMException(exec, exception);