Skip to content

Commit a459860

Browse files
committed
Merge branch 'develop' of github.com:eclipse/paho.mqtt.java into develop
2 parents 50fde4c + 94bd84a commit a459860

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Please read the [Eclipse Foundation policy on accepting contributions via Git](h
2020

2121
## Contributing a change
2222

23-
## Contributing a change
24-
2523
1. [Fork the repository on GitHub](https://github.com/eclipse/paho.mqtt.java/fork)
2624
2. Clone the forked repository onto your computer: ``` git clone https://github.com/<your username>/paho.mqtt.java.git ```
2725
3. Create a new branch from the latest ```develop``` branch with ```git checkout -b YOUR_BRANCH_NAME origin/develop```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Red Hat Inc.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Red Hat Inc - initial API and implementation
10+
*******************************************************************************/
11+
package org.eclipse.paho.client.mqttv3.test;
12+
13+
import org.eclipse.paho.client.mqttv3.MqttAsyncClient;
14+
import org.eclipse.paho.client.mqttv3.MqttException;
15+
import org.junit.Test;
16+
17+
/**
18+
* This is a reproducer for issue #370
19+
*/
20+
public class Issue370Test {
21+
@Test
22+
public void noOpenClose() throws MqttException {
23+
final MqttAsyncClient client = new MqttAsyncClient("tcp://localhost", "foo-bar");
24+
client.close();
25+
}
26+
}

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/ClientState.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2016 IBM Corp.
2+
* Copyright (c) 2009, 2017 IBM Corp and others.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -17,6 +17,7 @@
1717
* James Sutton - Ping Callback (bug 473928)
1818
* Ian Craggs - fix for NPE bug 470718
1919
* James Sutton - Automatic Reconnect & Offline Buffering
20+
* Jens Reimann - Fix issue #370
2021
*/
2122
package org.eclipse.paho.client.mqttv3.internal;
2223

@@ -1354,7 +1355,9 @@ public int getMaxInFlight(){
13541355
*/
13551356
protected void close() {
13561357
inUseMsgIds.clear();
1357-
pendingMessages.clear();
1358+
if (pendingMessages != null) {
1359+
pendingMessages.clear();
1360+
}
13581361
pendingFlows.clear();
13591362
outboundQoS2.clear();
13601363
outboundQoS1.clear();

0 commit comments

Comments
 (0)