Blanket not calling dtors would be problematic, there's no way to be
sure what side effects that would have. One solution would be to
specialize the dealloc function for QRawFont objects to check if the
application is exiting and abort.
Another might be to register a cleanup function using the atexit module
that calls deletes all QRawFont objects (at least their underlying C++
objects), though since atexit is
called from Py_Finalize() that would only work if Qt hasn't released
FreeType at that time.
Kovid.
On Sun, Oct 28, 2012 at 01:17:05PM +0000, Phil Thompson wrote:
> On Sun, 28 Oct 2012 15:38:59 +0530, Kovid Goyal <kovid at kovidgoyal.net>
> wrote:
> > The backtrace is below. Looks to me like the QRawFont object is being
> > released after Qt has already released the FreeType library, leading to
> > the segfault. The workaround is to ensure that all QRawFont objects are
> > deleted before Py_Finalize() is called. I dont know if there is more
> > elegant way to fix this in PyQt.
>> The best solution at the moment is to explicitly del problematic objects
> when the application terminates.
>> PyQt does have a mechanism for doing this automatically but only for
> QObjects and it has to be explicitly coded.
>> At the moment SIP disables the calling of any Python reimplementations of
> virtuals when an application exits. I could extend this to disable any
> calls to C++ dtors when Python objects get garbage collected. This would be
> optional and enabled by function implemented in the sip module. It would be
> disabled by default (to reflect the current behaviour) as I'm not sure if
> it might break current applications.
>> Thoughts?
>> Phil
>> > #0 0x00007ffff4061e3a in freeServerGlyphSet (id=39845946,
> this=<optimized
> > out>) at text/qfontengine_x11.cpp:1146
> > #1 QFontEngineX11FT::freeServerGlyphSet (this=0xa922f0, id=39845946) at
> > text/qfontengine_x11.cpp:1141
> > #2 0x00007ffff4068e89 in QFontEngineFT::freeGlyphSets (this=0xa922f0)
> at
> > text/qfontengine_ft.cpp:658
> > #3 0x00007ffff4061ccb in QFontEngineX11FT::~QFontEngineX11FT
> > (this=0xa922f0, __in_chrg=<optimized out>) at
> text/qfontengine_x11.cpp:1127
> > #4 0x00007ffff4061d09 in QFontEngineX11FT::~QFontEngineX11FT
> > (this=0xa922f0, __in_chrg=<optimized out>) at
> text/qfontengine_x11.cpp:1128
> > #5 0x00007ffff405f0ef in QRawFontPrivate::cleanUp (this=0xa5c290) at
> > text/qrawfont.cpp:699
> > #6 0x00007ffff405f194 in ~QRawFontPrivate (this=0xa5c290,
> > __in_chrg=<optimized out>) at text/qrawfont_p.h:94
> > #7 ~QExplicitlySharedDataPointer (this=<optimized out>,
> > __in_chrg=<optimized out>) at
> > ../../include/QtCore/../../src/corelib/tools/qshareddata.h:166
> > #8 ~QExplicitlySharedDataPointer (this=<optimized out>,
> > __in_chrg=<optimized out>) at text/qrawfont.cpp:174
> > #9 QRawFont::~QRawFont (this=<optimized out>, __in_chrg=<optimized
> out>)
> > at text/qrawfont.cpp:174
> > #10 0x00007ffff4b55f46 in release_QRawFont (sipCppV=0xa087f0) at
> > sipQtGuiQRawFont.cpp:936
> > #11 0x00007ffff5208e74 in forgetObject (sw=0x7fffec9bf980) at
> > siplib.c:10199
> > #12 0x00007ffff5208ea9 in sipSimpleWrapper_dealloc (self=0x7fffec9bf980)
> > at siplib.c:9449
> > #13 0x00007ffff7ab7b66 in subtype_dealloc (self=0x7fffec9bf980) at
> > Objects/typeobject.c:1014
> > #14 0x00007ffff7a986f7 in insertdict (mp=0x641000, key=0x7ffff7f7d788,
> > hash=13056039271, value=0x7ffff7da4b30 <_Py_NoneStruct>) at
> > Objects/dictobject.c:530
> > #15 0x00007ffff7a9abb4 in PyDict_SetItem (op=0x641000,
> key=0x7ffff7f7d788,
> > value=0x7ffff7da4b30 <_Py_NoneStruct>) at Objects/dictobject.c:775
> > #16 0x00007ffff7a9e5dc in _PyModule_Clear (m=<optimized out>) at
> > Objects/moduleobject.c:138
> > #17 0x00007ffff7b0d7bf in PyImport_Cleanup () at Python/import.c:445
> > #18 0x00007ffff7b1a035 in Py_Finalize () at Python/pythonrun.c:454
> > #19 0x00007ffff7b2aacc in Py_Main (argc=<optimized out>, argv=<optimized
> > out>) at Modules/main.c:668
> > #20 0x00007ffff747760d in __libc_start_main (main=0x400970 <main>,
> argc=3,
> > ubp_av=0x7fffffffda68, init=<optimized out>, fini=<optimized out>,
> > rtld_fini=<optimized out>, stack_end=0x7fffffffda58) at libc-start.c:226
> > #21 0x00000000004008a9 in _start ()
> >
> > Kovid.
> >
> > On Fri, Oct 19, 2012 at 07:38:18PM +0530, Kovid Goyal wrote:
> >> Hi Phil,
> >>
> >> The following snippet causes a segfault:
> >>
> >> python -c "from PyQt4.Qt import *; app = QApplication([]); f =
> >> QRawFont.fromFont(QFont('Arial')); print f.familyName(); print 1"
> >>
> >> However, if I explicitly delete the QRawFont first, the segfault goes
> >> away:
> >>
> >> python -c "from PyQt4.Qt import *; app = QApplication([]); f =
> >> QRawFont.fromFont(QFont('Arial')); print f.familyName(); del f; print
> 1"
> >>
> >> Seems to be something wrong in the object lifetime/ownership
> >> semantics for QRawFont.
> >>
> >> This is on linux PyQt4 4.9.4, SIP 4.14, Qt 4.8.3
> >>
> >> I am unable to generate a backtrace at the moment as I am travelling,
> >> let me know if you need one, and I'll try to generate it ASAP.
> >>
> >> Kovid.
> >>
> >>
> >> --
> >> _____________________________________
> >>
> >> Dr. Kovid Goyal
> >> http://www.kovidgoyal.net
> >> http://calibre-ebook.com
> >> _____________________________________
> >
> >
> >
> >> _______________________________________________
> >> PyQt mailing list PyQt at riverbankcomputing.com
> >> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> >>
> >>
>> !DSPAM:3,508d305447621662420518!
>>
--
_____________________________________
Dr. Kovid Goyal
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121028/5d147f1c/attachment.pgp>
More information about the PyQt
mailing list
‘She has never mentioned her father to me. Was he—well, the sort of man whom the County Club would not have blackballed?’ "We walked by the side of our teams or behind the wagons, we slept on the ground at night, we did our own cooking, we washed our knives by sticking them into the ground rapidly a few times, and we washed our plates with sand and wisps of grass. When we stopped, we arranged our wagons in a circle, and thus formed a 'corral,' or yard, where we drove our oxen to yoke them up. And the corral was often very useful as a fort, or camp, for defending ourselves against the Indians. Do you see that little hollow down there?" he asked, pointing to a depression in the ground a short distance to the right of the train. "Well, in that hollow our wagon-train was kept three days and nights by the Indians. Three days and nights they stayed around, and made several attacks. Two of our men were killed and three were wounded by their arrows, and others had narrow escapes. One arrow hit me on the throat, but I was saved by the knot of my neckerchief, and the point only tore the skin a little. Since that time I have always had a fondness for large neckties. I don't know how many of the Indians we killed, as they carried off their dead and wounded, to save them from being scalped. Next to getting the scalps of their enemies, the most important thing with the Indians is to save their own. We had several fights during our journey, but that one was the worst. Once a little party of us were surrounded in a small 'wallow,' and had a tough time to defend ourselves successfully. Luckily for us, the Indians had no fire-arms then, and their bows and arrows were no match for our rifles. Nowadays they are well armed, but there are[Pg 41] not so many of them, and they are not inclined to trouble the railway trains. They used to do a great deal of mischief in the old times, and many a poor fellow has been killed by them." As dusk came on nearly the whole population of Maastricht, with all their temporary guests, formed an endless procession and went to invoke God's mercy by the Virgin Mary's intercession. They went to Our Lady's Church, in which stands the miraculous statue of Sancta Maria Stella Maris. The procession filled all the principal streets and squares of the town. I took my stand at the corner of the Vrijthof, where all marched past me, men, women, and children, all praying aloud, with loud voices beseeching: "Our Lady, Star of the Sea, pray for us ... pray for us ... pray for us ...!" It had not occurred to her for some hours after Mrs. Campbell had told her of Landor's death that she was free now to give herself to Cairness. She had gasped, indeed, when she did remember it, and had put the thought away, angrily and self-reproachfully. But it returned now, and she felt that she might cling to it. She had been grateful, and she had been faithful, too.[Pg 286] She remembered only that Landor had been kind to her, and forgot that for the last two years she had borne with much harsh coldness, and with a sort of contempt which she felt in her unanalyzing mind to have been entirely unmerited. Gradually she raised herself until she sat quite erect by the side of the mound, the old exultation of her half-wild girlhood shining in her face as she planned the future, which only a few minutes before had seemed so hopeless. After he had gloated over Sergeant Ramsey, Shorty got his men into the road ready to start. Si placed himself in front of the squad and deliberately loaded his musket in their sight. Shorty took his place in the rear, and gave out: The groups about each gun thinned out, as the shrieking fragments of shell mowed down man after man, but the rapidity of the fire did not slacken in the least. One of the Lieutenants turned and motioned with his saber to the riders seated on their horses in the line of limbers under the cover of the slope. One rider sprang from each team and ran up to take the place of men who had fallen. "As long as there's men and women in the world, the men 'ull be top and the women bottom." Then, in the house, the little girls were useful. Mrs. Backfield was not so energetic as she used to be. She had never been a robust woman, and though her husband's care had kept her well and strong, her frame was not equal to Reuben's demands; after fourteen years' hard labour, she suffered from rheumatism, which though seldom acute, was inclined to make her stiff and slow. It was here that Caro and Tilly came in, and Reuben began to appreciate his girls. After all, girls were needed in a house—and as for young men and marriage, their father could easily see that such follies did not spoil their usefulness or take them from him. Caro and Tilly helped their grandmother in all sorts of ways—they dusted, they watched pots, they shelled peas and peeled potatoes, they darned house-linen, they could even make a bed between them. HoME一级毛片视频免费公开
ENTER NUMBET 0018feizaoju.com.cn www.hymedimage.com.cn www.lejinjidian.com.cn cqcq01.com.cn www.elefine.com.cn thht.net.cn www.zjcypt.com.cn jwho.com.cn www.7410.net.cn www.kmpaige.com.cn