握住RCP:设备没有跟踪资源分配 [英] Sleak in RCP: Device is not tracking resource allocation
问题描述
我已经尝试在我的Indigo RCP应用程序中使Sleak工作。我已按照本指南。即我已经安装了插件,将swt工具插件添加到当前的插件中,添加了所需的插件,修改了跟踪选项,并使用 folder.addView(org.eclipse.swt。这个视图确实会显示出来,但是我不断收到错误'设备不跟踪资源分配'。
I have tried to make Sleak work on my Indigo RCP application. I have followed the steps on this guide. I.e. I have installed the plugin, added the swt tools plugin to current plugins, added the required plugins, modified the tracing options, and added the view in my application with folder.addView("org.eclipse.swt.tools.views.SleakView");
当我尝试使用它。
我已经尝试了在stackoverflow中的旧问题的答案,但没有运气
I have tried the answers to older questions in stackoverflow on the matter, but had no luck
Sleak(SWT & RCP):设备不跟踪资源分配(eclipse 4.3)
I已明确检查.options文件中加载调试配置确实具有所需的跟踪选项。
I have explicitly checked that the .options file loaded in the debug configuration does indeed have both the tracing options needed.
任何其他想法?
推荐答案
我最近遇到了同样的问题,并设法找到一个解决方案。这是我发现的,谁知道它可能会帮助你。
I faced the same problem recently, and managed to find a solution. Here's what I found, who knows it might help you.
在RCP启动时,有一个调用$ code PlatformUI.createDisplay(),其链接到 Workbench.createDisplay()
的调用。这是Sleak所需的调试设置被正确读取和设置的确切点。
On RCP startup, there's a call to PlatformUI.createDisplay()
, which chains to a call to Workbench.createDisplay()
. That's the exact point where the debug settings needed by Sleak are properly read and set.
我们的软件发生了什么是调用显示。在上述调用
它导致创建一个新的Display对象,它被设置为默认值。这个创建没有读取并设置调试设置。 PlatformUI.createDisplay()
之前,getDefault()
What happened on our software was that a call to Display.getDefault()
was made BEFORE the above call to PlatformUI.createDisplay()
. It caused the creation of a new Display object, which was set as the default. This creation did not read and set the debug settings.
当我们的代码到达 PlatformUI.createDisplay()
调用,它实际上并没有创建一个新的显示。相反,它返回了之前创建的,不调试的友好的。因此,引导关键词设备不跟踪资源分配的警告。
By the time our code got to the PlatformUI.createDisplay()
call, it didn't actually create a new Display. Instead, it returned the previously-created, not-debug-friendly one. Thus leading Sleak into warning about "device not tracking resource allocation".
在方法中添加断点Display.register(显示显示) code>帮助我们识别早期的创作来源,并正确地改变它。
Adding a breakpoint at the method Display.register (Display display)
helped us identifying the early creation origin and properly change it.
这篇关于握住RCP:设备没有跟踪资源分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!