Bug 64682 - [DND] Drag-and-Drop DropTarget cleanup is not complete
Summary: [DND] Drag-and-Drop DropTarget cleanup is not complete
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact: Kevin Barnes CLA
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2004-05-29 18:11 EDT by gateway CLA
Modified: 2020-05-08 12:32 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gateway CLA 2004-05-29 18:11:18 EDT
Problem:
--------
DropTarget cleanup (COM-level) does not seem to be complete. Instantiating
another DragDrop instance within the same process
fails after calling CoLockObjectExternal COM API.

org.eclipse.swt.SWTError: Cannot initialize Drop
	at org.eclipse.swt.dnd.DND.error(DND.java:220)
	at org.eclipse.swt.dnd.DND.error(DND.java:181)
	at org.eclipse.swt.dnd.DropTarget.<init>(DropTarget.java:133)
	at
org.eclipse.swt.examples.dnd.DNDExample.createDropTarget(DNDExample.java:640)
	at org.eclipse.swt.examples.dnd.DNDExample.access$2000
(DNDExample.java:21)
	at
org.eclipse.swt.examples.dnd.DNDExample$25.widgetSelected(DNDExample.java:839)
	at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2578)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2256)
	at org.eclipse.swt.examples.dnd.DNDExample.open(DNDExample.java:1101)
	at org.eclipse.swt.examples.dnd.DNDExample.access$000
(DNDExample.java:21)
	at org.eclipse.swt.examples.dnd.DNDExample$1.run(DNDExample.java:67)
	at java.lang.Thread.run(Thread.java:534)

Environment:
------------
Windows XP Pro 2002 SP1
SWT M08
j2sdk1.4.2_03

Steps to reproduce:
------------------
1. Modify DNDExample.java (SWT sample), main() method as shown below, so
that 
it displays two Shell instances, one after another:
public static void main(String[] args) throws Exception{
    //fisrt instance works OK
    DNDExample example = new DNDExample();
    example.open();

    //second instance has problems with DropTarget initialization
    //for cleaner experiment, let's use another UI thread
    Runnable runnable = new Runnable() {
        public void run() {
            DNDExample example2 = new DNDExample();
            example2.open();
        }
    };
    new Thread(runnable).start();

    Thread.sleep(Long.MAX_VALUE);
}

2. Run DNDExample, make sure example Shell is displayed.
3. Click on DropTarget check box, which causes creation of DropTarget
associated with Label control.
4. Close the Shell, which causes disposal of Label control and associated
DropTarget. When DropTarget refCount becomes 0, disposeCOMInterfaces()
method is called, which should completely release all system resources
associated with DropTarget.
5. Make sure example2 Shell instance is displayed.
6. Click on DropTarget check box, which should create another DropTarget
instance. Instead, SWT fails with stack trace provided above.
Comment 1 Leo Ufimtsev CLA 2017-08-03 12:32:36 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 2 Eclipse Genie CLA 2020-05-08 12:32:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.