Skip to content

Commit

Permalink
make sure there is somethung to close
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Aug 7, 2024
1 parent 5751cc9 commit 9115272
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -226,7 +227,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -222,7 +223,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -222,7 +223,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -221,7 +222,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -221,7 +222,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -223,7 +224,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/ai/nets/samj/communication/model/SAM2Tiny.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentation
* {@inheritDoc}
*/
public void notifyUiHasBeenClosed() {
log.info(FULL_NAME+": OKAY, I'm closing myself...");
if (log != null)
log.info(FULL_NAME+": OKAY, I'm closing myself...");
closeProcess();
}

Expand All @@ -226,7 +227,8 @@ public void notifyUiHasBeenClosed() {
* {@inheritDoc}
*/
public void closeProcess() {
efficientSamJ.close();
if (efficientSamJ != null)
efficientSamJ.close();
efficientSamJ = null;
}

Expand Down

0 comments on commit 9115272

Please sign in to comment.