Closed
Bug 554008
Opened 15 years ago
Closed 15 years ago
QApplication init must be initialized in ContentProcessChild, not in TabChild
Categories
(Core :: IPC, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: romaxa, Assigned: romaxa)
Details
Attachments
(2 files, 2 obsolete files)
3.30 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
1.24 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
TabChilds can be created and destroyed in the same process, and we should not create and destroy QApplication every time when it happens.
Attachment #433909 -
Flags: review?(Olli.Pettay)
Comment 1•15 years ago
|
||
Why not create QApplication already in ContentProcessChild ctor?
And actually, since ContentProcessChild is a singleton, it could have QApplication
as a member variable. That would look a bit nicer.
Comment 2•15 years ago
|
||
I wonder if the member variable could be even
nsAutoPtr<QApplication> mQApp;
Then ContentProcessChild dtor should automatically delete the object.
Assignee | ||
Comment 3•15 years ago
|
||
Assignee: nobody → romaxa
Attachment #433909 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #433916 -
Flags: review?(Olli.Pettay)
Attachment #433909 -
Flags: review?(Olli.Pettay)
Assignee | ||
Comment 4•15 years ago
|
||
Attachment #433916 -
Attachment is obsolete: true
Attachment #433917 -
Flags: review?(Olli.Pettay)
Attachment #433916 -
Flags: review?(Olli.Pettay)
Comment 5•15 years ago
|
||
Comment on attachment 433917 [details] [diff] [review]
QApp init moved to ctor
>diff -r 12cce72d1dd7 dom/ipc/ContentProcessChild.cpp
>--- a/dom/ipc/ContentProcessChild.cpp Mon Mar 22 15:36:54 2010 +0200
>+++ b/dom/ipc/ContentProcessChild.cpp Mon Mar 22 16:00:30 2010 +0200
> ContentProcessChild::ContentProcessChild()
> : mQuit(PR_FALSE)
> {
>+#ifdef MOZ_WIDGET_QT
>+ NS_ASSERTION(!qApp, "QApplication created too early?");
>+ mQApp = new QApplication(gArgc, (char**)gArgv);
Not sure why you need (char**)
Attachment #433917 -
Flags: review?(Olli.Pettay) → review+
Comment 6•15 years ago
|
||
Ah, perhaps QApplication has overloaded ctors.
Assignee | ||
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•15 years ago
|
||
I think we should redo this patch, because ContentProcessChild ctor created not in main thread, and as result we have problems like:
***********************
QPixmap: It is not safe to use pixmaps outside the GUI thread
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0x14220), parent's thread is QThread(0x1b3a0), current thread is QThread(0x499f2
8)
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::startTimer: QTimer can only be used with threads started with QThread
[TabChild] MOVE to (x,y)=(0d, 0d), (w,h)= (0d, 0d)
###################################### frame-content loaded
loading about:blank, 1
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
***********************
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 9•15 years ago
|
||
Attachment #434480 -
Flags: review?(Olli.Pettay)
Assignee | ||
Updated•15 years ago
|
Attachment #434480 -
Flags: review?(Olli.Pettay) → review?(dougt)
Updated•15 years ago
|
Attachment #434480 -
Flags: review?(dougt) → review+
Assignee | ||
Comment 10•15 years ago
|
||
Additional fix pushed in:
http://hg.mozilla.org/projects/electrolysis/rev/c732df81ad85
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Comment 11•15 years ago
|
||
Uh, I didn't know the ctor is run in different thread than init.
You need to log in
before you can comment on or make changes to this bug.
Description
•