Ownership of page Widget plumbed to top.
Now it's created by `make_unique`.
This commit is contained in:
10
src/form.cc
10
src/form.cc
@ -945,7 +945,6 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
|
||||
|
||||
if (inp_type != DILLO_HTML_INPUT_UNKNOWN) {
|
||||
/* Render the button */
|
||||
Widget *page;
|
||||
Embed *embed;
|
||||
const char *attrbuf;
|
||||
char *name, *value;
|
||||
@ -959,19 +958,18 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
|
||||
/* We used to have Textblock (prefs.limit_text_width, ...) here,
|
||||
* but it caused 100% CPU usage.
|
||||
*/
|
||||
page = new Textblock (false, true);
|
||||
std::unique_ptr< Widget > page_unique;
|
||||
page_unique.reset( page );
|
||||
std::unique_ptr< Widget > page = std::make_unique< Textblock >( false, true );
|
||||
Widget *page_p= page.get();
|
||||
page->setStyle (html->backgroundStyle ());
|
||||
|
||||
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
|
||||
Resource *resource = factory->createComplexButtonResource(std::move( page_unique ), true);
|
||||
Resource *resource = factory->createComplexButtonResource(std::move( page ), true);
|
||||
embed = new Embed(resource);
|
||||
// a_Dw_button_set_sensitive (DW_BUTTON (button), FALSE);
|
||||
|
||||
HT2TB(html)->addWidget (embed, html->backgroundStyle ());
|
||||
|
||||
S_TOP(html)->textblock = html->dw = page;
|
||||
S_TOP(html)->textblock = html->dw = page_p;
|
||||
|
||||
value = a_Html_get_attr_wdef(html, tag, tagsize, "value", NULL);
|
||||
name = a_Html_get_attr_wdef(html, tag, tagsize, "name", NULL);
|
||||
|
Reference in New Issue
Block a user