Project

General

Profile

« Previous | Next » 

Revision 692fd528

Added by Patrick Plitzner about 5 years ago

ref #6925 Set conversation and cdmEntitySession to null for dispose

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/e4/ReferencingObjectsViewE4.java
461 461
	public void dispose() {
462 462
	    if(conversation!=null){
463 463
	        conversation.close();
464
	        conversation = null;
464 465
	    }
465 466
	}
466 467

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/e4/CdmAuthorityEditorE4.java
137 137
	    if(conversation!=null){
138 138
	        conversation.unregisterForDataStoreChanges(this);
139 139
	        conversation.close();
140
	        conversation = null;
140 141
	    }
141 142
		if(input!=null){
142 143
		    input.getCdmEntitySession().dispose();
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyListEditorE4.java
12 12
import java.util.List;
13 13

  
14 14
import javax.annotation.PostConstruct;
15
import javax.annotation.PreDestroy;
15 16
import javax.inject.Inject;
16 17

  
17 18
import org.eclipse.core.runtime.IProgressMonitor;
......
240 241
        menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.polytomouskeylisteditor");
241 242
	}
242 243

  
244

  
245
    @PreDestroy
246
    public void dispose() {
247
        if(input!=null){
248
            input.dispose();
249
            input.getConversationHolder().close();
250
        }
251
    }
252

  
243 253
	public int getTableItemCount() {
244 254
	    if (viewer != null && viewer.getTable() != null) {
245 255
	        return viewer.getTable().getItemCount();
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
765 765
     */
766 766
    @Override
767 767
    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
768
        conversation.clear();
769
        conversation.close();
770
        conversation = null;
771 768
    }
772 769

  
773 770
    private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions", //$NON-NLS-1$
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
496 496
    public void dispose() {
497 497
        if(conversation!=null){
498 498
            conversation.close();
499
            conversation = null;
499 500
        }
500 501
        if(cdmEntitySession != null) {
501 502
            cdmEntitySession.dispose();
503
            cdmEntitySession = null;
502 504
        }
503 505
    }
504 506

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/CharacterEditor.java
247 247
    public void dispose(){
248 248
        if(conversation!=null){
249 249
            conversation.close();
250
            conversation = null;
250 251
        }
251 252
        if(cdmEntitySession != null) {
252 253
            cdmEntitySession.dispose();
254
            cdmEntitySession = null;
253 255
        }
254 256
    }
255 257

  
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/e4/AlignmentEditorE4.java
376 376

  
377 377

  
378 378
    @PreDestroy
379
	public void dispose() {
380
		Display.getCurrent().removeFilter(SWT.FocusIn, ACTION_UPDATER);
381
		Display.getCurrent().removeFilter(SWT.FocusOut, ACTION_UPDATER);
382
		CLIPBOARD.dispose();
379
    public void dispose() {
380
        Display.getCurrent().removeFilter(SWT.FocusIn, ACTION_UPDATER);
381
        Display.getCurrent().removeFilter(SWT.FocusOut, ACTION_UPDATER);
382
        CLIPBOARD.dispose();
383 383
        input.dispose();
384
	}
384

  
385
        if(conversationHolder!=null){
386
            conversationHolder.close();
387
            conversationHolder = null;
388
        }
389
        if(input!=null){
390
            input.dispose();
391
        }
392
    }
385 393

  
386 394

  
387 395
	private void updateStatusBar() {
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartE4.java
249 249
            conversation.unregisterForDataStoreChanges(this);
250 250
            conversation.close();
251 251
            CdmStore.getContextManager().removeContextListener(contextListener);
252
            conversation = null;
252 253
        }
253 254
        if(cdmEntitySession != null) {
254 255
            cdmEntitySession.dispose();
256
            cdmEntitySession = null;
255 257
        }
256 258
        ICdmDataChangeService currentDataChangeService = CdmApplicationState.getCurrentDataChangeService();
257 259
        if(currentDataChangeService!=null){
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java
292 292
	    viewer.setInput(new EmptyRoot());
293 293
	}
294 294

  
295
	public void restore(IMemento memento, IProgressMonitor monitor) {
295
	private void restore(IMemento memento, IProgressMonitor monitor) {
296 296
	    root = new Root(conversation);
297 297
		if (memento == null) {
298 298
		    viewer.setInput(root);
......
400 400
		dataChangeBehavior = null;
401 401
		if (conversation != null) {
402 402
			conversation.unregisterForDataStoreChanges(this);
403
			conversation = null;
403 404
		}
404 405
		if(cdmEntitySession != null) {
405 406
		    cdmEntitySession.dispose();
407
		    cdmEntitySession = null;
406 408
		}
407 409
		if(CdmApplicationState.getCurrentDataChangeService() != null) {
408 410
		    CdmApplicationState.getCurrentDataChangeService().unregister(this);
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/e4/SearchResultViewE4.java
290 290
	public void dispose() {
291 291
		if(conversation!=null){
292 292
		    conversation.close();
293
		    conversation = null;
293 294
		}
294 295
		if(searchJob != null) {
295 296
            searchJob.cancel();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java
40 40
    }
41 41

  
42 42
    public void bind() {
43
        cdmEntitySession.bind();
43
        if(cdmEntitySession!=null){
44
            cdmEntitySession.bind();
45
        }
44 46
    }
45 47

  
46 48
    public void dispose() {
47 49
        cdmEntitySession.dispose();
50
        cdmEntitySession = null;
48 51
    }
49 52

  
50 53
    public abstract void merge();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
234 234
	    if(conversation!=null){
235 235
	        conversation.unregisterForDataStoreChanges(this);
236 236
	        conversation.close();
237
	        conversation = null;
237 238
	    }
238 239
	    if(input!=null){
239 240
	        input.dispose();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
209 209
	public void dispose(){
210 210
        if(conversation!=null){
211 211
            conversation.close();
212
            conversation = null;
212 213
        }
213 214
        if(cdmEntitySession != null) {
214 215
            cdmEntitySession.dispose();
216
            cdmEntitySession = null;
215 217
        }
216 218
	}
217 219

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/AbstractNewEntityWizard.java
55 55

  
56 56
		conversation.commit();
57 57
		conversation.close();
58
		conversation = null;
58 59
		return true;
59 60
	}
60 61

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
213 213
        super.dispose();
214 214
        if(cdmEntitySession != null) {
215 215
            cdmEntitySession.dispose();
216
            cdmEntitySession = null;
216 217
        }
217 218
        if(previousCdmEntitySession!=null){
218 219
            previousCdmEntitySession.bind();

Also available in: Unified diff