[libxml++] parse_stream with auto_ptr



Hi!

I try to use the dom parser in the following way:

    ....
    auto_ptr<istream> xmlStream(new stringstream("<foo/>"));
    ....
    parser.parse_stream(*xmlStream);
    ....

But this always causes a segfault. And I have absolutely no idea why.
This code works:

    ....
    auto_ptr<istream> xmlStream(new stringstream("<foo/>"));
    ....
    stringstream s;
    s << (*xmlStream).rdbuf();
    parser.parse_stream(s);
    ....

Any idea, why parse_stream() doesn't like the auto_ptr?

Regards,

Tobias







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]