OutputView Model

Niko Sams niko.sams at gmail.com
Sat Jan 30 22:27:05 UTC 2010


On Sat, Jan 30, 2010 at 22:25, Andreas Pakulat <apaku at gmx.de> wrote:
> On 30.01.10 21:59:34, Niko Sams wrote:
>> Hi,
>>
>> I'm trying to fix that crash:
>> https://bugs.kde.org/show_bug.cgi?id=222317
>> By setting OutputJob::m_outputModel to 0 when the model gets deleted.
>>
>> And I found out that the OutputModel is only deleted on kdevelop quit.
>
> Apparently OutputData doesn't have a destructor that deletes the model
> and delegate if it own either or both.
>
>> Same with ToolViewData
>
> Uhm, unless I'm mistaken toolview data is deleted when a toolview is
> removed (see StandardOutputView::removeToolView). Of course if you don't
> close the toolview explicitly that'll only happen on shutdown (or maybe
> the standardoutputview::cleanup function doesn't remove all toolviews?
The destructors of OutputModel, OutputData and ToolViewData are never called
except on shutdown.
I closed an outputview (for a single job) and removed the whole view.
(But my problem is now solved using QWeakPointer anyway)

>> and OutputData.
>
> That is true, the destructor of ToolViewData doesn't delete its output
> data's.
>
>> And: what is the use case for IOutputView::setModel() with KeepOwnership?
>
> That the registrator of the outputview doesn't get its model deleted
> behind his back. There are outputviews where the model is "long-lived"
> (svn for example) and where removal of an outputview must not delete the
> underlying model.
ah, ok.

> Forgot to answer this part, I guess using a QWeakPointer in the job
> would make sense so the job can safely check wether the model is gone
> already or not.
Ok, I did that.

thanks,
Niko




More information about the KDevelop-devel mailing list