Lines 3-14
Link Here
|
3 |
|
3 |
|
4 |
--- extensions/gtkmoz_browser_element/browser_element.cc.orig |
4 |
--- extensions/gtkmoz_browser_element/browser_element.cc.orig |
5 |
+++ extensions/gtkmoz_browser_element/browser_element.cc |
5 |
+++ extensions/gtkmoz_browser_element/browser_element.cc |
6 |
@@ -380,7 +380,7 @@ |
6 |
@@ -157,7 +157,7 @@ |
7 |
for (size_t i = 0; kBrowserChildNames[i]; ++i) { |
7 |
std::string up_fd_str = StringPrintf("%d", up_fds[1]); |
8 |
execl(kBrowserChildNames[i], kBrowserChildNames[i], |
8 |
for (size_t i = 0; kBrowserChildNames[i]; ++i) { |
9 |
down_fd_str.c_str(), up_fd_str.c_str(), |
9 |
execl(kBrowserChildNames[i], kBrowserChildNames[i], |
10 |
- ret_fd_str.c_str(), NULL); |
10 |
- down_fd_str.c_str(), up_fd_str.c_str(), NULL); |
11 |
+ ret_fd_str.c_str(), (char*)0); |
11 |
+ down_fd_str.c_str(), up_fd_str.c_str(), (char*)0); |
12 |
} |
12 |
} |
13 |
LOG("Failed to execute browser child"); |
13 |
LOG("Failed to execute browser child"); |
14 |
_exit(-1); |
14 |
_exit(-1); |
|
|
15 |
@@ -416,6 +416,8 @@ |
16 |
object_id_str_(StringPrintf("%zu", object_id)), |
17 |
call_self_(this), |
18 |
to_string_(NewSlot(this, &BrowserObjectWrapper::ToString)) { |
19 |
+ if (parent_) |
20 |
+ parent_->Ref(); |
21 |
} |
22 |
|
23 |
virtual ~BrowserObjectWrapper() { |
24 |
@@ -426,6 +428,8 @@ |
25 |
owner_->controller_->SendCommand(kUnrefCommand, owner_->browser_id_, |
26 |
object_id_str_.c_str(), NULL); |
27 |
} |
28 |
+ if (parent_) |
29 |
+ parent_->Unref(); |
30 |
} |
31 |
|
32 |
void OnOwnerDestroy() { |
33 |
@@ -523,8 +527,8 @@ |
34 |
buffer += '\n'; |
35 |
buffer += wrapper_->object_id_str_; |
36 |
buffer += '\n'; |
37 |
- if (wrapper_->parent_.Get()) |
38 |
- buffer += wrapper_->parent_.Get()->object_id_str_; |
39 |
+ if (wrapper_->parent_) |
40 |
+ buffer += wrapper_->parent_->object_id_str_; |
41 |
for (int i = 0; i < argc; i++) { |
42 |
buffer += '\n'; |
43 |
buffer += wrapper_->owner_->EncodeValue(argv[i]); |
44 |
@@ -546,7 +550,7 @@ |
45 |
}; |
46 |
|
47 |
BrowserElementImpl *owner_; |
48 |
- ScriptableHolder<BrowserObjectWrapper> parent_; |
49 |
+ BrowserObjectWrapper *parent_; |
50 |
size_t object_id_; |
51 |
std::string object_id_str_; |
52 |
CallSelfSlot call_self_; |