Index: webkit/glue/plugins/plugin_string_stream.cc |
=================================================================== |
--- webkit/glue/plugins/plugin_string_stream.cc (revision 31913) |
+++ webkit/glue/plugins/plugin_string_stream.cc (working copy) |
@@ -21,6 +21,10 @@ |
void PluginStringStream::SendToPlugin(const std::string &data, |
const std::string &mime_type) { |
+ // Protect the stream against it being destroyed or the whole plugin instance |
+ // being destroyed within the plugin stream callbacks. |
+ scoped_refptr<PluginStringStream> protect(this); |
+ |
int length = static_cast<int>(data.length()); |
if (Open(mime_type, std::string(), length, 0, false)) { |
// TODO - check if it was not fully sent, and figure out a backup plan. |