Skip to content

Commit dca99ea

Browse files
authored
Merge pull request #21 from electricimp/develop
Fixed memory leak
2 parents b2322da + e59418b commit dca99ea

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

DHCP/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This library class enables Dynamic Host Configuration Protocol (DHCP) functional
55
**To include this library in your project, add the following at the top of your device code:**
66

77
```squirrel
8-
#require "W5500.device.lib.nut:2.2.0"
8+
#require "W5500.device.lib.nut:2.2.1"
99
#require "W5500.DHCP.device.lib.nut:2.0.1"
1010
```
1111

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wiznet W5500 2.2.0 #
1+
# Wiznet W5500 2.2.1 #
22

33
The W5500 chip is a hardwired TCP/IP embedded Ethernet controller. We have two libraries for use with the [Wiznet W5500 chip](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5500:w5500_ds_v106e_141230.pdf).
44

@@ -8,7 +8,7 @@ In addition we have a W5500.DHCP library that enables Dynamic Host Configuration
88

99
The W5500 is used by the [impAccelerator™ Fieldbus Gateway](https://developer.electricimp.com/hardware/resources/reference-designs/fieldbusgateway).
1010

11-
**To include the base library in your project, add** `#require "W5500.device.lib.nut:2.2.0"` **at the top of your device code**
11+
**To include the base library in your project, add** `#require "W5500.device.lib.nut:2.2.1"` **at the top of your device code**
1212

1313
## W5500 Class Usage ##
1414

W5500.device.lib.nut

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIT License
22
//
3-
// Copyright 2016-2019 Electric Imp
3+
// Copyright 2016-2021 Electric Imp
44
//
55
// SPDX-License-Identifier: MIT
66
//
@@ -270,7 +270,7 @@ const W5500_INTERRUPT_POLL_TIME_ACTIVE = 0.01;
270270

271271
class W5500 {
272272

273-
static VERSION = "2.2.0";
273+
static VERSION = "2.2.1";
274274

275275
_driver = null;
276276
// Set to true once the driver is loaded and connection to chip made
@@ -2151,6 +2151,7 @@ class W5500.Connection {
21512151
_driver.closeConnection(_socket, _getHandler("close"));
21522152
_handlers = {};
21532153
if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer);
2154+
_interrupt_timer = null;
21542155
}
21552156

21562157

@@ -2266,6 +2267,8 @@ class W5500.Connection {
22662267
// Parameters: socket the interrupt occurred on
22672268
// **************************************************************************
22682269
function handleInterrupt(skip_timer = false) {
2270+
if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer);
2271+
_interrupt_timer = null;
22692272

22702273
local status = _driver.getSocketInterruptTypeStatus(_socket);
22712274

@@ -2393,7 +2396,6 @@ class W5500.Connection {
23932396
}
23942397

23952398
// Scan the interrupt again very soon
2396-
if (_interrupt_timer) imp.cancelwakeup(_interrupt_timer);
23972399
if (_socket in _driver._connections) {
23982400
local timer_time = ("receive" in _handlers) ? W5500_INTERRUPT_POLL_TIME_ACTIVE : W5500_INTERRUPT_POLL_TIME_IDLE;
23992401
_interrupt_timer = imp.wakeup(timer_time, handleInterrupt.bindenv(this))

examples/BasicUsageExample.device.nut

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIT License
22
//
3-
// Copyright 2016-2019 Electric Imp
3+
// Copyright 2016-2021 Electric Imp
44
//
55
// SPDX-License-Identifier: MIT
66
//
@@ -22,7 +22,7 @@
2222
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2323
// OTHER DEALINGS IN THE SOFTWARE.
2424

25-
#require "W5500.device.lib.nut:2.2.0"
25+
#require "W5500.device.lib.nut:2.2.1"
2626

2727
//================================================
2828
// Define Settings

examples/DHCP_Example.device.nut

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIT License
22
//
3-
// Copyright 2016-2019 Electric Imp
3+
// Copyright 2016-2021 Electric Imp
44
//
55
// SPDX-License-Identifier: MIT
66
//
@@ -26,7 +26,7 @@
2626
// Hardware: imp005 Fieldbus Gateway
2727

2828
// Include Libraries
29-
#require "W5500.device.lib.nut:2.2.0"
29+
#require "W5500.device.lib.nut:2.2.1"
3030
#require "W5500.DHCP.device.lib.nut:2.0.1"
3131

3232
// Configure Echo Server Settings

0 commit comments

Comments
 (0)